Changeset 1178 in MondoRescue for branches/stable/mondo/src/lib/mr_mem.c
- Timestamp:
- Feb 17, 2007, 2:27:26 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/lib/mr_mem.c
r1174 r1178 110 110 } 111 111 } 112 113 /* 114 * Equivalent function of strcat but safe 115 * from memory allocation point of view 116 */ 117 void mr_strcat_int(char **in, const char *add, int line, char *file) { 118 char *p =NULL; 119 120 if (add == NULL) { 121 return; 122 } 123 if (in == NULL) { 124 mr_msg_int(1,line,file,"Unable to add %s to NULL pointer\nExiting...", add); 125 mr_exit(-1, "Unable to add to a NULL pointer"); 126 } 127 if (*in == NULL) { 128 mr_asprintf_int(&p,line,file,add); 129 } else { 130 mr_asprintf_int(&p,line,file,"%s%s",*in,add); 131 mr_free_int((void **)in,line,file); 132 } 133 *in = p; 134 }
Note:
See TracChangeset
for help on using the changeset viewer.