Changeset 3615 in MondoRescue for branches/3.2/mondo/src/common/libmondo-fork.c
- Timestamp:
- Nov 18, 2016, 5:31:43 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mondo/src/common/libmondo-fork.c
r3610 r3615 38 38 * caller 39 39 */ 40 char *call_program_and_get_last_line_of_output(char *call) 41 { 40 char *call_program_and_get_last_line_of_output(const char *call) { 42 41 /*@ buffers ***************************************************** */ 43 42 char *result = NULL; 44 char *tmp = NULL; 43 char *resultbkp = NULL; 44 char *result2 = NULL; 45 45 46 46 /*@ pointers **************************************************** */ … … 59 59 if (strlen(result) > 1) { 60 60 log_msg(7, "result = '%s'", result); 61 /* in case we have to loop, we keep the 62 * previous value */ 63 mr_free(resultbkp); 64 mr_asprintf(resultbkp, "%s", result); 65 } else { 66 /* we had to loop and got nothing useul, so we keep the 67 * previous value */ 68 mr_free(result); 69 result = resultbkp; 61 70 } 62 71 } … … 66 75 } 67 76 mr_free(eng_call); 68 mr_strip_spaces(result); 69 log_msg(5, "cpaglloo returns '%s'", result); 70 return(result); 77 if (result != NULL) { 78 result2 = mr_strip_spaces(result); 79 mr_free(result); 80 log_msg(5, "cpaglloo returns '%s'", result2); 81 } else { 82 mr_asprintf(result2, ""); 83 } 84 return(result2); 71 85 } 72 86
Note:
See TracChangeset
for help on using the changeset viewer.