From 1b343b87f94470fb214cbdb7eac5ea283dacab9b Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 14 May 2007 21:36:29 +0000 Subject: [PATCH] Tweak doc. --- lib/linebuffer.c | 4 ++-- lib/linebuffer.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/linebuffer.c b/lib/linebuffer.c index 6317271c2..77f2a047a 100644 --- a/lib/linebuffer.c +++ b/lib/linebuffer.c @@ -47,9 +47,9 @@ readlinebuffer (struct linebuffer *linebuffer, FILE *stream) } /* Read an arbitrarily long line of text from STREAM into LINEBUFFER. - Consder lines to be terminated by DELIMITER. + Consider lines to be terminated by DELIMITER. Keep the delimiter; append DELIMITER if it's the last line of a file - that ends in a character other than DELIMITER. Do not null terminate. + that ends in a character other than DELIMITER. Do not NUL-terminate. Therefore the stream can contain NUL bytes, and the length (including the delimiter) is returned in linebuffer->length. Return NULL when stream is empty. Return NULL and set errno upon diff --git a/lib/linebuffer.h b/lib/linebuffer.h index dd62709ea..7e5960a47 100644 --- a/lib/linebuffer.h +++ b/lib/linebuffer.h @@ -37,15 +37,15 @@ void initbuffer (struct linebuffer *linebuffer); /* Read an arbitrarily long line of text from STREAM into LINEBUFFER. Consider lines to be terminated by DELIMITER. Keep the delimiter; append DELIMITER if we reach EOF and it wasn't - the last character in the file. Do not null terminate. - Return LINEBUFFER, except at end of file return 0. */ + the last character in the file. Do not NUL-terminate. + Return LINEBUFFER, except at end of file return NULL. */ struct linebuffer *readlinebuffer_delim (struct linebuffer *linebuffer, FILE *stream, char delimiter); /* Read an arbitrarily long line of text from STREAM into LINEBUFFER. Keep the newline; append a newline if it's the last line of a file - that ends in a non-newline character. Do not null terminate. - Return LINEBUFFER, except at end of file return 0. */ + that ends in a non-newline character. Do not NUL-terminate. + Return LINEBUFFER, except at end of file return NULL. */ struct linebuffer *readlinebuffer (struct linebuffer *linebuffer, FILE *stream); /* Free linebuffer LINEBUFFER and its data, all allocated with malloc. */ -- 2.11.0