We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 676673e commit db468f1Copy full SHA for db468f1
src/fetch.c
@@ -54,12 +54,12 @@ char *pipeRead(const char *exec)
54
if (pipe == NULL)
55
return NULL;
56
char *returnVal = malloc(256);
57
- const int scanf_return = fscanf(pipe, "%[^\n]s", returnVal);
+ const int scanf_return = fscanf(pipe, "%[^\n]256s", returnVal);
58
+ pclose(pipe);
59
if (scanf_return == EOF) {
60
fprintf(stderr, "ERROR: scanf failed!\n");
61
exit(EXIT_FAILURE);
62
}
- pclose(pipe);
63
return returnVal;
64
65
0 commit comments