PostGIS  3.4.0dev-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 262 of file stringbuffer.c.

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

References s.