mirror of
https://github.com/simon987/sist2.git
synced 2025-12-11 14:38:54 +00:00
Bug fix
This commit is contained in:
@@ -126,7 +126,12 @@ int index_args_validate(index_args_t *args, int argc, const char **argv) {
|
||||
}
|
||||
|
||||
args->script = malloc(info.st_size + 1);
|
||||
read(fd, args->script, info.st_size);
|
||||
res = read(fd, args->script, info.st_size);
|
||||
if (res == -1) {
|
||||
fprintf(stderr, "Error reading script file '%s': %s\n", args->script_path, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
||||
*(args->script + info.st_size) = '\0';
|
||||
close(fd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user