Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ef561ce

Browse files
committedApr 11, 2023
Fix conversions between char and int
1 parent 93b2db9 commit ef561ce

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎linenoise.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,7 @@ char *linenoiseEditFeed(struct linenoiseState *l) {
931931

932932
char c;
933933
int nread;
934+
int ret;
934935
char seq[3];
935936

936937
nread = read(l->ifd,&c,1);
@@ -940,11 +941,12 @@ char *linenoiseEditFeed(struct linenoiseState *l) {
940941
* there was an error reading from fd. Otherwise it will return the
941942
* character that should be handled next. */
942943
if ((l->in_completion || c == 9) && completionCallback != NULL) {
943-
c = completeLine(l,c);
944+
ret = completeLine(l,(unsigned char)c);
944945
/* Return on errors */
945-
if (c < 0) return NULL;
946+
if (ret < 0) return NULL;
946947
/* Read next character when 0 */
947-
if (c == 0) return linenoiseEditMore;
948+
if (ret == 0) return linenoiseEditMore;
949+
c = (char)ret;
948950
}
949951

950952
switch(c) {

0 commit comments

Comments
 (0)
Please sign in to comment.