Changeset 2383 in MondoRescue for branches/2.2.10/mondo/src/common/libmondo-fork.c
- Timestamp:
- Sep 10, 2009, 2:55:51 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/libmondo-fork.c
r2382 r2383 37 37 { 38 38 /*@ buffers ***************************************************** */ 39 static char result[512]; 40 char *tmp = NULL; 39 char *result = NULL; 41 40 42 41 /*@ pointers **************************************************** */ 43 42 FILE *fin; 44 43 45 /*@ initialize data ********************************************* */46 result[0] = '\0';47 48 44 /*@******************************************************************** */ 49 45 50 46 assert_string_is_neither_NULL_nor_zerolength(call); 51 47 if ((fin = popen(call, "r"))) { 52 for (mr_getline(tmp, fin); !feof(fin); mr_getline(tmp, fin)) { 53 if (strlen(tmp) > 1) { 54 strncpy(result, tmp, 511); 55 } 56 mr_free(tmp); 57 } 58 mr_free(tmp); 48 for (mr_getline(result, fin); !feof(fin); mr_getline(result, fin)); 59 49 paranoid_pclose(fin); 60 50 } else { 61 51 log_OS_error("Unable to popen call"); 62 52 } 63 strip_spaces(result);64 return 53 mr_strip_spaces(result); 54 return(result); 65 55 } 66 56
Note:
See TracChangeset
for help on using the changeset viewer.