function: lx_chomp()
USAGE:
char lx_chomp(lx_s *s, char *cstr)
Remove all ending characters located in cstr from string buffer
s.
This is done by modifying s->len. lx_chomp() does not
deallocate or overwrite any memory used by s.
PROPERTIES |
return value |
0 on success (1 on out-of-memory error) |
allocation ensured |
n/a |
previous allocation required |
yes |
SEE ALSO:
EXAMPLE:
char get_line (gd, s, match)
lx_gd *gd;
lx_s *s;
char *match;
{
if (lx_getln(s, gd, match, 4096)) _exit (1);
return lx_chomp (s, '\n\r '); /* remove newline, and any carriage */
/* returns or spaces that may exist */
/* at the end of s */
}