Fixes.
This commit is contained in:
parent
9dce51de18
commit
d26013a90f
4
tools.h
4
tools.h
@ -41,7 +41,7 @@ char * tool_function_bash(char * command){
|
||||
fp = popen(command, "r");
|
||||
if (fp == NULL) {
|
||||
perror("popen failed");
|
||||
return "Popen failed!";
|
||||
return strdup("Popen failed!");
|
||||
}
|
||||
|
||||
// Read output in chunks
|
||||
@ -52,7 +52,7 @@ char * tool_function_bash(char * command){
|
||||
perror("realloc failed");
|
||||
free(output);
|
||||
pclose(fp);
|
||||
return "Failed to allocate memory!";
|
||||
return strdup("Failed to allocate memory!");
|
||||
}
|
||||
output = new_output;
|
||||
strcpy(output + total_size, buffer);
|
||||
|
Loading…
Reference in New Issue
Block a user