diff --git a/Makefile b/Makefile index 09478c36..5d170576 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ linenoise_example: linenoise.c example.c - $(CC) -Wall -W -Os -o linenoise_example linenoise.c example.c + $(CC) -Wall -W -Os -g -o linenoise_example linenoise.c example.c clean: rm -f linenoise_example diff --git a/linenoise.c b/linenoise.c index 6aabe176..8f9c24a3 100644 --- a/linenoise.c +++ b/linenoise.c @@ -396,7 +396,7 @@ int linenoiseHistoryAdd(const char *line) { char *linecopy; if (history_max_len == 0) return 0; - if (history == 0) { + if (history == NULL) { history = malloc(sizeof(char*)*history_max_len); if (history == NULL) return 0; memset(history,0,(sizeof(char*)*history_max_len));