OSDN Git Service

getpass: s/sizeof(buf)-1/sizeof(buf)/ in fgets
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 1 Jan 2012 16:31:40 +0000 (17:31 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 1 Jan 2012 16:31:40 +0000 (17:31 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libc/unistd/getpass.c

index dd927ab..c311a15 100644 (file)
@@ -75,7 +75,7 @@ char * getpass (const char *prompt)
   fflush(out);
 
   /* Read the password.  */
-  if (!fgets (buf, sizeof(buf)-1, in))
+  if (!fgets (buf, sizeof(buf), in))
     buf[0] = '\0';
   nread = strlen(buf);
   if (nread > 0 && buf[nread - 1] == '\n')