diff options
author | Thorsten Glaser <tg@mirbsd.org> | 2009-12-10 18:07:25 +0100 |
---|---|---|
committer | Guillem Jover <guillem@hadrons.org> | 2009-12-10 21:07:02 +0100 |
commit | c17c7e13c3522c6d72ceb4bc207308b8c7452b44 (patch) | |
tree | 012d3ad22b44c1e6c455a44fba0429d32a447410 /src | |
parent | a5dbef45e77f1de47b11669443ece451e90b85ab (diff) | |
download | libbsd-c17c7e13c3522c6d72ceb4bc207308b8c7452b44.tar.gz |
Expand on API guarantee for fgetln
OpenBSD has begun using the API guarantee that *len is not 0 if
the fgetln(3) return value is not NULL; document this explicitly
in the manpage and add a comment to the function implementation
that this doesn’t need to be checked because getdelim/getline have
similar guarantees.
Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/fgetln.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/fgetln.c b/src/fgetln.c index 6e3d000..317880d 100644 --- a/src/fgetln.c +++ b/src/fgetln.c @@ -39,6 +39,7 @@ fgetln (FILE *stream, size_t *len) ssize_t nread; nread = getline(&line, &line_len, stream); + /* Note: the getdelim/getline API ensures nread != 0. */ if (nread == -1) { *len = 0; return NULL; |