diff options
author | sandman <sandman@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2002-07-19 00:05:54 +0000 |
---|---|---|
committer | sandman <sandman@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2002-07-19 00:05:54 +0000 |
commit | 88c37e3b6514ce684e6f5f38282176f34fc73d0d (patch) | |
tree | 945ff88bbbde5a32c2b3342b22d801be90ea40f2 /coreutils/expr.c | |
parent | d4dbffaf02bf1c39047688988c44c8d60277a76a (diff) | |
download | busybox-w32-88c37e3b6514ce684e6f5f38282176f34fc73d0d.tar.gz busybox-w32-88c37e3b6514ce684e6f5f38282176f34fc73d0d.tar.bz2 busybox-w32-88c37e3b6514ce684e6f5f38282176f34fc73d0d.zip |
Applied vodz' patches #49 and #50 (with a small correction in runshell.c)
#49: I found one memory overflow and memory leak in "ln" applet.
Last patch reduced also 54 bytes. ;)
#50: I found bug in loginutils/Makefile.in.
New patch have also new function to libbb and
aplied this to applets and other cosmetic changes.
git-svn-id: svn://busybox.net/trunk/busybox@5066 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils/expr.c')
-rw-r--r-- | coreutils/expr.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/coreutils/expr.c b/coreutils/expr.c index 0299cc73a..55ae3a969 100644 --- a/coreutils/expr.c +++ b/coreutils/expr.c | |||
@@ -146,12 +146,8 @@ static int null (VALUE *v) | |||
146 | 146 | ||
147 | static void tostring (VALUE *v) | 147 | static void tostring (VALUE *v) |
148 | { | 148 | { |
149 | char *temp; | ||
150 | |||
151 | if (v->type == integer) { | 149 | if (v->type == integer) { |
152 | temp = xmalloc (4 * (sizeof (int) / sizeof (char))); | 150 | bb_asprintf (&(v->u.s), "%d", v->u.i); |
153 | sprintf (temp, "%d", v->u.i); | ||
154 | v->u.s = temp; | ||
155 | v->type = string; | 151 | v->type = string; |
156 | } | 152 | } |
157 | } | 153 | } |
@@ -377,9 +373,7 @@ static VALUE *eval6 (void) | |||
377 | else { | 373 | else { |
378 | v = xmalloc (sizeof(VALUE)); | 374 | v = xmalloc (sizeof(VALUE)); |
379 | v->type = string; | 375 | v->type = string; |
380 | v->u.s = strncpy ((char *) xmalloc (i2->u.i + 1), | 376 | v->u.s = xstrndup(l->u.s + i1->u.i - 1, i2->u.i); |
381 | l->u.s + i1->u.i - 1, i2->u.i); | ||
382 | v->u.s[i2->u.i] = 0; | ||
383 | } | 377 | } |
384 | freev (l); | 378 | freev (l); |
385 | freev (i1); | 379 | freev (i1); |