diff mbox

[RFC/PoC,2/4] getdelim: Change cur_len from ssize_t to size_t

Message ID 1428928117-8643-3-git-send-email-rv@rasmusvillemoes.dk
State New, archived
Headers show

Commit Message

Rasmus Villemoes April 13, 2015, 12:28 p.m. UTC
In preparation for introducing getdelim_append, change the type of
cur_len to size_t.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
---
 libio/iogetdelim.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/libio/iogetdelim.c b/libio/iogetdelim.c
index 6606c4b..eeda0eb 100644
--- a/libio/iogetdelim.c
+++ b/libio/iogetdelim.c
@@ -44,7 +44,7 @@  _IO_getdelim (lineptr, n, delimiter, fp)
      _IO_FILE *fp;
 {
   _IO_ssize_t result = 0;
-  _IO_ssize_t cur_len = 0;
+  _IO_size_t cur_len = 0;
   _IO_ssize_t len;
 
   if (lineptr == NULL || n == NULL)
@@ -89,7 +89,7 @@  _IO_getdelim (lineptr, n, delimiter, fp)
       t = (char *) memchr ((void *) fp->_IO_read_ptr, delimiter, len);
       if (t != NULL)
 	len = (t - fp->_IO_read_ptr) + 1;
-      if (__glibc_unlikely (len >= SSIZE_MAX - cur_len) ||
+      if (__glibc_unlikely (len >= SIZE_MAX - cur_len) ||
 	  __glibc_unlikely (len >= SSIZE_MAX - result))
 	{
 	  __set_errno (EOVERFLOW);