diff options
Diffstat (limited to 'coreutils/expr.c')
-rw-r--r-- | coreutils/expr.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/coreutils/expr.c b/coreutils/expr.c index 725196039..0a1baa19d 100644 --- a/coreutils/expr.c +++ b/coreutils/expr.c | |||
@@ -25,14 +25,8 @@ | |||
25 | 25 | ||
26 | /* no getopt needed */ | 26 | /* no getopt needed */ |
27 | 27 | ||
28 | #include <stdio.h> | ||
29 | #include <string.h> | ||
30 | #include <stdlib.h> | ||
31 | #include <regex.h> | ||
32 | #include <sys/types.h> | ||
33 | #include <errno.h> | ||
34 | #include "busybox.h" | 28 | #include "busybox.h" |
35 | 29 | #include "xregex.h" | |
36 | 30 | ||
37 | /* The kinds of value we can have. */ | 31 | /* The kinds of value we can have. */ |
38 | enum valtype { | 32 | enum valtype { |
@@ -116,9 +110,9 @@ static VALUE *str_value (char *s) | |||
116 | { | 110 | { |
117 | VALUE *v; | 111 | VALUE *v; |
118 | 112 | ||
119 | v = xmalloc (sizeof(VALUE)); | 113 | v = xmalloc(sizeof(VALUE)); |
120 | v->type = string; | 114 | v->type = string; |
121 | v->u.s = bb_xstrdup (s); | 115 | v->u.s = xstrdup(s); |
122 | return v; | 116 | return v; |
123 | } | 117 | } |
124 | 118 | ||
@@ -148,7 +142,7 @@ static int null (VALUE *v) | |||
148 | static void tostring (VALUE *v) | 142 | static void tostring (VALUE *v) |
149 | { | 143 | { |
150 | if (v->type == integer) { | 144 | if (v->type == integer) { |
151 | v->u.s = bb_xasprintf ("%" PF_REZ "d", PF_REZ_TYPE v->u.i); | 145 | v->u.s = xasprintf("%" PF_REZ "d", PF_REZ_TYPE v->u.i); |
152 | v->type = string; | 146 | v->type = string; |
153 | } | 147 | } |
154 | } | 148 | } |
@@ -366,7 +360,7 @@ static VALUE *eval6 (void) | |||
366 | else { | 360 | else { |
367 | v = xmalloc (sizeof(VALUE)); | 361 | v = xmalloc (sizeof(VALUE)); |
368 | v->type = string; | 362 | v->type = string; |
369 | v->u.s = bb_xstrndup(l->u.s + i1->u.i - 1, i2->u.i); | 363 | v->u.s = xstrndup(l->u.s + i1->u.i - 1, i2->u.i); |
370 | } | 364 | } |
371 | freev (l); | 365 | freev (l); |
372 | freev (i1); | 366 | freev (i1); |