Skip to contentSkip to conversation

linux-2.6.0/sound/core/misc.c - vsnprintf

PATCH New petter wahlman 1 participant 1 message Dec 29, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-2.6.0/sound/core/misc.c - vsnprintf

hi,

vsnprintf does not copy more than 'size' bytes _including_ '\0'

-p.

--- linux-2.6.0/sound/core/misc.c 2003-12-18 03:58:38.000000000
+0100
+++ linux-2.6.0-pw/sound/core/misc.c 2003-12-29 14:42:15.000000000
+0100
@@ -51,9 +51,8 @@

                printk("ALSA %s:%d: ", file, line);
        }
        va_start(args, format);
-       vsnprintf(tmpbuf, sizeof(tmpbuf)-1, format, args);
+       vsnprintf(tmpbuf, sizeof(tmpbuf), format, args);
        va_end(args);
-       tmpbuf[sizeof(tmpbuf)-1] = '\0';
        printk(tmpbuf);
 }
 #endif
@@ -73,9 +72,8 @@
                printk(KERN_DEBUG "ALSA %s:%d: ", file, line);
        }
        va_start(args, format);
-       vsnprintf(tmpbuf, sizeof(tmpbuf)-1, format, args);
+       vsnprintf(tmpbuf, sizeof(tmpbuf), format, args);
        va_end(args);
-       tmpbuf[sizeof(tmpbuf)-1] = '\0';
        printk(tmpbuf);

}