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

Function RemoveTrailingWhitespace

scripts/BossCamera.cpp:192–200  ·  view source on GitHub ↗

Removes any whitespace padding from the end of a string

Source from the content-addressed store, hash-verified

190
191// Removes any whitespace padding from the end of a string
192void RemoveTrailingWhitespace(char *s) {
193 int last_char_pos;
194
195 last_char_pos = strlen(s) - 1;
196 while (last_char_pos >= 0 && isspace(s[last_char_pos])) {
197 s[last_char_pos] = '\0';
198 last_char_pos--;
199 }
200}
201
202// Returns a pointer to the first non-whitespace char in given string
203char *SkipInitialWhitespace(char *s) {

Callers 1

ReadMessageFileFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected