Changeset 45 in MondoRescue for trunk/mondo/mondo/common/libmondo-string.c
- Timestamp:
- Oct 5, 2005, 12:51:47 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/mondo/common/libmondo-string.c
r44 r45 66 66 67 67 68 69 68 /** 70 69 * Pad a string on both sides so it appears centered. … … 101 100 102 101 103 104 105 102 inline void turn_wildcard_chars_into_literal_chars(char *sout, char *sin) 106 103 { … … 114 111 *q = *p; // for the final '\0' 115 112 } 116 117 113 118 114 … … 127 123 char *pos_w_commas; 128 124 static char output[MAX_STR_LEN]; 129 char tmp[MAX_STR_LEN];125 char *tmp; 130 126 int j; 131 127 132 128 assert(input != NULL); 133 129 134 strcpy(tmp, input);130 asprintf(tmp, "%s", input); 135 131 if (strlen(tmp) > 6) { 136 132 asprintf(&pos_w_commas, "%s", tmp); … … 151 147 strcpy(output, pos_w_commas); 152 148 paranoid_free(pos_w_commas); 149 paranoid_free(tmp); 153 150 return (output); 154 151 } … … 169 166 170 167 /*@ buffers ********************************************************** */ 171 static char output[MAX_STR_LEN];168 char *output; 172 169 173 170 assert(disklist != NULL); 174 171 175 sprintf(output, "%-24s %8d", disklist->el[lino].device,176 disklist->el[lino].index);172 asprintf(&output, "%-24s %8d", disklist->el[lino].device, 173 disklist->el[lino].index); 177 174 return (output); 178 175 } 179 180 181 182 176 183 177 … … 214 208 outval = atol(tmp); 215 209 paranoid_free(tmp); 210 216 211 if (ch == 'g' || ch == 'G') { 217 212 outval = outval * 1024; … … 563 558 564 559 565 566 567 560 /** 568 561 * Wrap @p flaws_str across three lines. The first two are no more than 74 characters wide. … … 614 607 } 615 608 } 616 617 609 618 610 … … 852 844 char *output; 853 845 854 855 856 846 if (raid_level >= 0) { 857 847 asprintf(&output, " RAID %-2d ", raid_level);
Note:
See TracChangeset
for help on using the changeset viewer.