svn commit: trunk/busybox/editors

vda at busybox.net vda at busybox.net
Wed Jul 2 22:47:49 UTC 2008


Author: vda
Date: 2008-07-02 15:47:49 -0700 (Wed, 02 Jul 2008)
New Revision: 22613

Log:
awk: another smallish code shrink



Modified:
   trunk/busybox/editors/awk.c


Changeset:
Modified: trunk/busybox/editors/awk.c
===================================================================
--- trunk/busybox/editors/awk.c	2008-07-02 16:26:23 UTC (rev 22612)
+++ trunk/busybox/editors/awk.c	2008-07-02 22:47:49 UTC (rev 22613)
@@ -2028,9 +2028,7 @@
 		if (i < 0) i = 0;
 		n = (nargs > 2) ? getvar_i(av[2]) : l-i;
 		if (n < 0) n = 0;
-		s = xzalloc(n + 1);
-		strncpy(s, as[0]+i, n);
-		/*s[n] = '\0'; - xzalloc did it */
+		s = xstrndup(as[0]+i, n);
 		setvar_p(res, s);
 		break;
 




More information about the busybox-cvs mailing list