Permalink
Browse files

suppress a warning on Linux adding some truly stupid code

  • Loading branch information...
1 parent 7f66909 commit 03e8e4dab590a2de2d1880a8700af0d69b7a1b14 antirez committed Dec 10, 2010
Showing with 3 additions and 1 deletion.
  1. +3 −1 linenoise.c
View
@@ -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) {

0 comments on commit 03e8e4d

Please sign in to comment.