Trims whitespace off the end of the stringbuffer.
Returns the number of characters trimmed.
Definition at line 232 of file stringbuffer.c.
233{
234 char *ptr =
s->str_end;
235 int dist = 0;
236
237
238 while( ptr >
s->str_start )
239 {
240 ptr--;
241 if( (*ptr == ' ') || (*ptr == '\t') )
242 {
243 continue;
244 }
245 else
246 {
247 ptr++;
248 dist =
s->str_end - ptr;
249 *ptr = '\0';
251 return dist;
252 }
253 }
254 return dist;
255}
References s.