| 293 | } |
| 294 | |
| 295 | void str_clean_whitespaces(char *str) |
| 296 | { |
| 297 | char *read = str; |
| 298 | char *write = str; |
| 299 | |
| 300 | /* skip initial whitespace */ |
| 301 | while(*read == ' ') |
| 302 | read++; |
| 303 | |
| 304 | /* end of read string is detected in the loop */ |
| 305 | while(true) |
| 306 | { |
| 307 | /* skip whitespace */ |
| 308 | int found_whitespace = 0; |
| 309 | for(; *read == ' '; read++) |
| 310 | found_whitespace = 1; |
| 311 | /* if not at the end of the string, put a found whitespace here */ |
| 312 | if(*read) |
| 313 | { |
| 314 | if(found_whitespace) |
| 315 | *write++ = ' '; |
| 316 | *write++ = *read++; |
| 317 | } |
| 318 | else |
| 319 | { |
| 320 | *write = 0; |
| 321 | break; |
| 322 | } |
| 323 | } |
| 324 | } |
| 325 | |
| 326 | char *str_skip_to_whitespace(char *str) |
| 327 | { |
no outgoing calls
no test coverage detected