- reinstate paranoia check in wrapf().
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Thu, 18 Jan 2007 08:41:22 +0000 (08:41 -0000)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Thu, 18 Jan 2007 08:41:22 +0000 (08:41 -0000)
coreutils/stty.c

index 3ce8bf3..4e665bc 100644 (file)
@@ -462,8 +462,9 @@ static void wrapf(const char *message, ...)
        va_start(args, message);
        buflen = vsnprintf(buf, sizeof(buf), message, args);
        va_end(args);
-       /* buflen = strlen(buf); cheaper not to pull in strlen */
-       if (!buflen /*|| buflen >= sizeof(buf)*/) return;
+       /* We seem to be called only with suitable lengths, but check if
+          somebody failed to adhere to this assumption just to be sure.  */
+       if (!buflen || buflen >= sizeof(buf)) return;
 
        if (current_col > 0) {
                current_col++;