MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / RemoveTrailingWhitespace

Function RemoveTrailingWhitespace

scripts/CellTestLevel.cpp:185–193  ·  view source on GitHub ↗

Removes any whitespace padding from the end of a string

Source from the content-addressed store, hash-verified

183
184// Removes any whitespace padding from the end of a string
185void RemoveTrailingWhitespace(char *s) {
186 int last_char_pos;
187
188 last_char_pos = strlen(s) - 1;
189 while (last_char_pos >= 0 && isspace(s[last_char_pos])) {
190 s[last_char_pos] = '\0';
191 last_char_pos--;
192 }
193}
194
195// Returns a pointer to the first non-whitespace char in given string
196char *SkipInitialWhitespace(char *s) {

Callers 1

ReadMessageFileFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected