aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-07-02 11:14:59 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-07-02 11:14:59 +0000
commite0a7fc54eb23f925d2ea885fb1b8699931f9001a (patch)
tree99cc437e3df9371efaa495c61cccabe2951c27ce /editors
parentd4f72438e42f93117fb2633d5d435e475f7e69e2 (diff)
downloadbusybox-w32-e0a7fc54eb23f925d2ea885fb1b8699931f9001a.tar.gz
busybox-w32-e0a7fc54eb23f925d2ea885fb1b8699931f9001a.tar.bz2
busybox-w32-e0a7fc54eb23f925d2ea885fb1b8699931f9001a.zip
uname,individual: fix improper printf usage
uname,awk: small code shrink function old new delta uname_main 175 166 -9 nvalloc 167 157 -10 evaluate 6381 6370 -11 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-30) Total: -30 bytes
Diffstat (limited to 'editors')
-rw-r--r--editors/awk.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/editors/awk.c b/editors/awk.c
index cc5dc84b5..44b747b29 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -852,11 +852,11 @@ static var *nvalloc(int n)
852 852
853 if (!g_cb) { 853 if (!g_cb) {
854 size = (n <= MINNVBLOCK) ? MINNVBLOCK : n; 854 size = (n <= MINNVBLOCK) ? MINNVBLOCK : n;
855 g_cb = xmalloc(sizeof(nvblock) + size * sizeof(var)); 855 g_cb = xzalloc(sizeof(nvblock) + size * sizeof(var));
856 g_cb->size = size; 856 g_cb->size = size;
857 g_cb->pos = g_cb->nv; 857 g_cb->pos = g_cb->nv;
858 g_cb->prev = pb; 858 g_cb->prev = pb;
859 g_cb->next = NULL; 859 /*g_cb->next = NULL; - xzalloc did it */
860 if (pb) pb->next = g_cb; 860 if (pb) pb->next = g_cb;
861 } 861 }
862 862
@@ -2028,9 +2028,9 @@ static var *exec_builtin(node *op, var *res)
2028 if (i < 0) i = 0; 2028 if (i < 0) i = 0;
2029 n = (nargs > 2) ? getvar_i(av[2]) : l-i; 2029 n = (nargs > 2) ? getvar_i(av[2]) : l-i;
2030 if (n < 0) n = 0; 2030 if (n < 0) n = 0;
2031 s = xmalloc(n+1); 2031 s = xzalloc(n + 1);
2032 strncpy(s, as[0]+i, n); 2032 strncpy(s, as[0]+i, n);
2033 s[n] = '\0'; 2033 /*s[n] = '\0'; - xzalloc did it */
2034 setvar_p(res, s); 2034 setvar_p(res, s);
2035 break; 2035 break;
2036 2036