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

Function RemoveTrailingWhitespace

scripts/Geodomes.cpp:236–244  ·  view source on GitHub ↗

Removes any whitespace padding from the end of a string

Source from the content-addressed store, hash-verified

234
235// Removes any whitespace padding from the end of a string
236void RemoveTrailingWhitespace(char *s) {
237 int last_char_pos;
238
239 last_char_pos = strlen(s) - 1;
240 while (last_char_pos >= 0 && isspace(s[last_char_pos])) {
241 s[last_char_pos] = '\0';
242 last_char_pos--;
243 }
244}
245
246// Returns a pointer to the first non-whitespace char in given string
247char *SkipInitialWhitespace(char *s) {

Callers 1

ReadMessageFileFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected