Commit 4ce393a66b10903a0ef52edf9775ed526a17395f

Salvatore Sanfilippo 2020-03-12T15:48:04

Merge pull request #185 from yossigo/fix-c99-warning Fix compilation in non C99/C11 mode.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/linenoise.c b/linenoise.c
index 01c3b93..ade4dea 100644
--- a/linenoise.c
+++ b/linenoise.c
@@ -598,7 +598,8 @@ static void refreshMultiLine(struct linenoiseState *l) {
     /* Write the prompt and the current buffer content */
     abAppend(&ab,l->prompt,strlen(l->prompt));
     if (maskmode == 1) {
-        for (uint i = 0; i < l->len; i++) abAppend(&ab,"*",1);
+        uint i;
+        for (i = 0; i < l->len; i++) abAppend(&ab,"*",1);
     } else {
         abAppend(&ab,l->buf,l->len);
     }