summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/ptsname.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/ptsname.c')
-rw-r--r--sysdeps/unix/sysv/linux/ptsname.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/ptsname.c b/sysdeps/unix/sysv/linux/ptsname.c
index 084e573260..da4809f372 100644
--- a/sysdeps/unix/sysv/linux/ptsname.c
+++ b/sysdeps/unix/sysv/linux/ptsname.c
@@ -75,7 +75,7 @@ __ptsname_r (int fd, char *buf, size_t buflen)
 {
   int save_errno = errno;
   struct stat64 st;
-  int ptyno;
+  unsigned int ptyno;
 
   if (buf == NULL)
     {
@@ -102,7 +102,7 @@ __ptsname_r (int fd, char *buf, size_t buflen)
       numbuf[sizeof (numbuf) - 1] = '\0';
       p = _itoa_word (ptyno, &numbuf[sizeof (numbuf) - 1], 10, 0);
 
-      if (buflen < devptslen + &numbuf[sizeof (numbuf)] - p)
+      if (buflen < devptslen + (&numbuf[sizeof (numbuf)] - p))
 	{
 	  __set_errno (ERANGE);
 	  return ERANGE;