#include <errno.h>
#include <string.h>
Go to the source code of this file.
- Author
- Joachim Wiberg
- Date
- 2014-2021
- Copyright
- ISC License
Definition in file chomp.c.
◆ 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. |
Definition at line 38 of file chomp.c.