Changeset 1215 in MondoRescue for branches/stable
- Timestamp:
- Feb 27, 2007, 7:07:36 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/lib/mr_str.c
r1205 r1215 123 123 */ 124 124 void mr_strip_spaces(char *in_out) { 125 int i ;126 int j ;125 int i = 0; 126 int j = 0; 127 127 size_t length; 128 128 … … 134 134 /* Skip initial spaces and special chars */ 135 135 for (i = 0; in_out[i] <= ' ' && i < (int)length ; i++); 136 /* Shift the string to the begining */ 137 for (j = 0; i < (int)length ; i++, j++) { 138 in_out[j] = in_out[i]; 136 /* Shift the string to the begining if needed */ 137 if (i != 0) { 138 for (j = 0; i < (int)length ; i++, j++) { 139 in_out[j] = in_out[i]; 140 } 141 /* Erase the end of the string if needed */ 142 j++; 143 in_out[j] = '\0'; 139 144 } 140 /* Erase the end of the string */141 j++;142 in_out[j] = '\0';143 145 144 146 /* Skip final spaces and special chars */
Note:
See TracChangeset
for help on using the changeset viewer.