do not segfault on empty input
This commit is contained in:
parent
3bc43448fc
commit
e332f72d22
@ -114,11 +114,15 @@ static void callback_handler(char *line) {
|
|||||||
char ch;
|
char ch;
|
||||||
shellpath(filename, sizeof(filename), line);
|
shellpath(filename, sizeof(filename), line);
|
||||||
file = fopen(filename, "a+");
|
file = fopen(filename, "a+");
|
||||||
seekpage(0);
|
if (file) {
|
||||||
while ((ch = getc(refsfound)) != EOF) {
|
seekpage(0);
|
||||||
putc(ch, file);
|
while ((ch = getc(refsfound)) != EOF) {
|
||||||
|
putc(ch, file);
|
||||||
|
}
|
||||||
|
fclose(file);
|
||||||
|
} else {
|
||||||
|
postmsg2("Failed to open file.");
|
||||||
}
|
}
|
||||||
fclose(file);
|
|
||||||
input_mode = INPUT_NORMAL;
|
input_mode = INPUT_NORMAL;
|
||||||
} return;
|
} return;
|
||||||
case INPUT_READ: {
|
case INPUT_READ: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user