lkml.org 
[lkml]   [2003]   [Dec]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] linux-2.6.0/sound/core/misc.c - vsnprintf
From
Date
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);

}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:59    [W:0.021 / U:1.864 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site