PostGIS  3.3.9dev-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 245 of file stringbuffer.c.

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

References s.