#include <errno.h>
#include <string.h>
|
char * | chomp (char *str) |
| Perl like chomp function, chop off last char(s) if newline. More...
|
|
- Author
- Joachim Wiberg
- Date
- 2014-2021
- Copyright
- ISC License
◆ chomp()
char* chomp |
( |
char * |
str | ) |
|
Perl like chomp function, chop off last char(s) if newline.
- Parameters
-
This function is like Perl chomp, but it's set to chop of all trailing newlines. Useful in combination with fgets().
- Returns
- str, or
NULL
with errno set, if str is not a valid pointer.
- Exceptions
-
EINVAL | if the input argument is not a valid pointer. |