diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/cli.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -37,16 +37,21 @@ cli_read_input(void) { char *txt = readline(""); - if ((!txt) || (*txt == '\0')) + if ((!txt) || (txt[0] == '\0')) { return DISP_QUIT; - if (*txt == 'q') + } + else if (txt[0] == 'q') { + free(txt); return DISP_QUIT; + } #ifndef NDEBUG if ((*txt == 'r') || (*txt == 'g')) return DISP_RELOAD; #endif - return atoi(txt); + int res = atoi(txt); + free(txt); + return res; } void |
