mirror of
https://github.com/antirez/linenoise.git
synced 2025-11-16 12:34:48 +00:00
enabled debugging symbols in Make, used NULL instead of 0 introduced for a typo
This commit is contained in:
2
Makefile
2
Makefile
@@ -1,5 +1,5 @@
|
|||||||
linenoise_example: linenoise.c example.c
|
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:
|
clean:
|
||||||
rm -f linenoise_example
|
rm -f linenoise_example
|
||||||
|
|||||||
@@ -396,7 +396,7 @@ int linenoiseHistoryAdd(const char *line) {
|
|||||||
char *linecopy;
|
char *linecopy;
|
||||||
|
|
||||||
if (history_max_len == 0) return 0;
|
if (history_max_len == 0) return 0;
|
||||||
if (history == 0) {
|
if (history == NULL) {
|
||||||
history = malloc(sizeof(char*)*history_max_len);
|
history = malloc(sizeof(char*)*history_max_len);
|
||||||
if (history == NULL) return 0;
|
if (history == NULL) return 0;
|
||||||
memset(history,0,(sizeof(char*)*history_max_len));
|
memset(history,0,(sizeof(char*)*history_max_len));
|
||||||
|
|||||||
Reference in New Issue
Block a user