Commit 03e8e4dab590a2de2d1880a8700af0d69b7a1b14

antirez 2010-12-10T19:21:28

suppress a warning on Linux adding some truly stupid code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/linenoise.c b/linenoise.c
index dd43413..bfed5ea 100644
--- a/linenoise.c
+++ b/linenoise.c
@@ -279,7 +279,9 @@ static int completeLine(int fd, const char *prompt, char *buf, size_t buflen, si
 }
 
 void linenoiseClearScreen(void) {
-    write(STDIN_FILENO,"\x1b[H\x1b[2J",7);
+    if (write(STDIN_FILENO,"\x1b[H\x1b[2J",7) <= 0) {
+        /* nothing to do, just to avoid warning. */
+    }
 }
 
 static int linenoisePrompt(int fd, char *buf, size_t buflen, const char *prompt) {