Trims whitespace off the end of the stringbuffer.
Returns the number of characters trimmed.
Definition at line 269 of file stringbuffer.c.
270{
271 char *ptr =
s->str_end;
272 int dist = 0;
273
274
275 while( ptr >
s->str_start )
276 {
277 ptr--;
278 if( (*ptr == ' ') || (*ptr == '\t') )
279 {
280 continue;
281 }
282 else
283 {
284 ptr++;
285 dist =
s->str_end - ptr;
286 *ptr = '\0';
288 return dist;
289 }
290 }
291 return dist;
292}
References s.