Strips leading and trailing spaces from a string Returns true if spaces were stripped
| 540 | // Strips leading and trailing spaces from a string |
| 541 | // Returns true if spaces were stripped |
| 542 | bool StripLeadingTrailingSpaces(char *s) { |
| 543 | char *t; |
| 544 | bool stripped = 0; |
| 545 | |
| 546 | // Look for leading spaces |
| 547 | t = s; |
| 548 | while (*t == ' ') |
| 549 | t++; |
| 550 | |
| 551 | // Leading spaces found, so copy string over spaces |
| 552 | if (t != s) { |
| 553 | strcpy(s, t); |
| 554 | stripped = 1; |
| 555 | } |
| 556 | |
| 557 | // Strip any trailing spaces |
| 558 | for (t = s + strlen(s) - 1; (t >= s) && (*t == ' '); t--) { |
| 559 | *t = 0; |
| 560 | stripped = 1; |
| 561 | } |
| 562 | |
| 563 | return stripped; |
| 564 | } |
| 565 | |
| 566 | // Check for duplicate names in the level |
| 567 | void CheckLevelNames() { |
no outgoing calls
no test coverage detected