diff options
author | Yang Tse <yangsita@gmail.com> | 2009-10-08 18:38:29 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2009-10-08 18:38:29 +0000 |
commit | f3346ca16b7c87d6cfe0c1605321dbf0a706e57a (patch) | |
tree | 4c1c80d858cb7d96b3740b1d3d60779c16a7f12e /ares__read_line.c | |
parent | e112f191a3d94510c74ff8a01b6446b61eb4b547 (diff) | |
download | c-ares-f3346ca16b7c87d6cfe0c1605321dbf0a706e57a.tar.gz c-ares-f3346ca16b7c87d6cfe0c1605321dbf0a706e57a.tar.bz2 c-ares-f3346ca16b7c87d6cfe0c1605321dbf0a706e57a.zip |
Fix compiler warning
Diffstat (limited to 'ares__read_line.c')
-rw-r--r-- | ares__read_line.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ares__read_line.c b/ares__read_line.c index bdb314c..a4399e3 100644 --- a/ares__read_line.c +++ b/ares__read_line.c @@ -30,7 +30,7 @@ * appropriate. The initial value of *buf should be NULL. After the * calling routine is done reading lines, it should free *buf. */ -int ares__read_line(FILE *fp, char **buf, int *bufsize) +int ares__read_line(FILE *fp, char **buf, size_t *bufsize) { char *newbuf; size_t offset = 0; @@ -46,7 +46,7 @@ int ares__read_line(FILE *fp, char **buf, int *bufsize) while (1) { - if (!fgets(*buf + offset, *bufsize - (int)offset, fp)) + if (!fgets(*buf + offset, *bufsize - offset, fp)) return (offset != 0) ? 0 : (ferror(fp)) ? ARES_EFILE : ARES_EOF; len = offset + strlen(*buf + offset); if ((*buf)[len - 1] == '\n') |