PostGIS  3.1.6dev-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 243 of file stringbuffer.c.

244 {
245  char *ptr = s->str_end;
246  int dist = 0;
247 
248  /* Roll backwards until we hit a non-space. */
249  while( ptr > s->str_start )
250  {
251  ptr--;
252  if( (*ptr == ' ') || (*ptr == '\t') )
253  {
254  continue;
255  }
256  else
257  {
258  ptr++;
259  dist = s->str_end - ptr;
260  *ptr = '\0';
261  s->str_end = ptr;
262  return dist;
263  }
264  }
265  return dist;
266 }
char * s
Definition: cu_in_wkt.c:23

References s.