diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-02 22:47:49 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-02 22:47:49 +0000 |
commit | 8ae5b28b4bff5f1099a4a77af89e1a7e23ad77e2 (patch) | |
tree | 7b564df0a853dd239ae4e47c8632e42ea9fe9b6a | |
parent | f8e8783a925255bbb275fc84a1b6126aba660e22 (diff) | |
download | busybox-w32-8ae5b28b4bff5f1099a4a77af89e1a7e23ad77e2.tar.gz busybox-w32-8ae5b28b4bff5f1099a4a77af89e1a7e23ad77e2.tar.bz2 busybox-w32-8ae5b28b4bff5f1099a4a77af89e1a7e23ad77e2.zip |
awk: another smallish code shrink
-rw-r--r-- | editors/awk.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/editors/awk.c b/editors/awk.c index 44b747b29..aac40aa93 100644 --- a/editors/awk.c +++ b/editors/awk.c | |||
@@ -2028,9 +2028,7 @@ 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 = xzalloc(n + 1); | 2031 | s = xstrndup(as[0]+i, n); |
2032 | strncpy(s, as[0]+i, n); | ||
2033 | /*s[n] = '\0'; - xzalloc did it */ | ||
2034 | setvar_p(res, s); | 2032 | setvar_p(res, s); |
2035 | break; | 2033 | break; |
2036 | 2034 | ||