PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ stringbuffer_trim_trailing_white()

int stringbuffer_trim_trailing_white ( stringbuffer_t s)

Trims whitespace off the end of the stringbuffer.

Returns the number of characters trimmed.

Definition at line 268 of file stringbuffer.c.

269 {
270  char *ptr = s->str_end;
271  int dist = 0;
272 
273  /* Roll backwards until we hit a non-space. */
274  while( ptr > s->str_start )
275  {
276  ptr--;
277  if( (*ptr == ' ') || (*ptr == '\t') )
278  {
279  continue;
280  }
281  else
282  {
283  ptr++;
284  dist = s->str_end - ptr;
285  *ptr = '\0';
286  s->str_end = ptr;
287  return dist;
288  }
289  }
290  return dist;
291 }
char * s
Definition: cu_in_wkt.c:23

References s.