diff options
author | Guillem Jover <guillem@hadrons.org> | 2015-09-22 16:22:56 +0200 |
---|---|---|
committer | Guillem Jover <guillem@hadrons.org> | 2015-09-23 07:59:34 +0200 |
commit | 151bc71d64845a1798561e66fa62ee0d62f4a03c (patch) | |
tree | c84778179105d861e9cb15f1e881d546a08adfe0 /src | |
parent | 41ff37bbccea236d67b0d54c97477741a6f13dab (diff) |
Add compile and link-time deprecation warnings for fgetln()
Although the current implementation in libbsd is probably one of the
safest ones around, it still poses some problems when used with many
file streams. This function has now a replacement, that is both more
standard and portable. Ask users to switch to getline(3) instead.
Diffstat (limited to 'src')
-rw-r--r-- | src/fgetln.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/fgetln.c b/src/fgetln.c index 6de804b..5f646e4 100644 --- a/src/fgetln.c +++ b/src/fgetln.c @@ -30,6 +30,8 @@ #include <sys/types.h> #include <string.h> +#include "local-link.h" + #ifdef HAVE_GETLINE struct filebuf { FILE *fp; @@ -68,6 +70,9 @@ fgetln(FILE *stream, size_t *len) return fb->buf; } } +libbsd_link_warning(fgetln, + "This functions cannot be safely ported, use getline(3) " + "instead, as it is supported by GNU and POSIX.1-2008.") #else #error "Function fgetln() needs to be ported." #endif |