PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ 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 269 of file stringbuffer.c.

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

References s.