Changeset 3837 in MondoRescue for branches/3.3/mondo/src/lib/mr_mem.c
- Timestamp:
- Mar 5, 2024, 2:51:50 AM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mondo/src/lib/mr_mem.c
r3645 r3837 53 53 } 54 54 55 /* encapsulation function for asprintf */ 55 /* 56 * Function that properly allocates a string from a format and params by encapsulating asprintf 57 * freeing it before in any case 58 */ 56 59 void mr_asprintf_int(char **strp, int line, const char *file, const char *fmt, ...) { 57 60 58 61 int res = 0; 59 62 va_list args; 63 64 if ((strp != NULL) && (*strp != NULL)) { 65 mr_free_int((void **)strp, line, file); 66 } 60 67 61 68 va_start(args,fmt); … … 89 96 mr_asprintf_int(lineptr,line,file,""); 90 97 } 91 }92 93 /*94 * Function that properly allocates a string from another one95 * freeing it before in any case96 */97 void mr_allocstr_int(char *alloc, const char *orig, int line, const char *file) {98 99 if (alloc != NULL) {100 mr_free_int((void **)&alloc, line, file);101 }102 mr_asprintf_int(&alloc, line, file, orig);103 98 } 104 99
Note:
See TracChangeset
for help on using the changeset viewer.