svn commit: trunk/busybox/coreutils

aldot at busybox.net aldot at busybox.net
Thu Jan 18 00:41:23 PST 2007


Author: aldot
Date: 2007-01-18 00:41:22 -0800 (Thu, 18 Jan 2007)
New Revision: 17361

Log:
- reinstate paranoia check in wrapf().


Modified:
   trunk/busybox/coreutils/stty.c


Changeset:
Modified: trunk/busybox/coreutils/stty.c
===================================================================
--- trunk/busybox/coreutils/stty.c	2007-01-18 01:12:57 UTC (rev 17360)
+++ trunk/busybox/coreutils/stty.c	2007-01-18 08:41:22 UTC (rev 17361)
@@ -462,8 +462,9 @@
 	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++;



More information about the busybox-cvs mailing list