]> git.lizzy.rs Git - linenoise.git/commitdiff
suppress a warning on Linux adding some truly stupid code
authorantirez <antirez@metal.(none)>
Fri, 10 Dec 2010 18:21:28 +0000 (19:21 +0100)
committerantirez <antirez@metal.(none)>
Fri, 10 Dec 2010 18:21:28 +0000 (19:21 +0100)
linenoise.c

index dd43413661ca9677c51667ca657daeca50706307..bfed5ea863f5511967b952bc76e709bd0e64e046 100644 (file)
@@ -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) {