aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-01-19 21:33:19 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-01-19 21:33:19 +0000
commit4ebaf1074218d4e1c2907114bc53080c5abbd57d (patch)
tree8abee9b7a3ed71e5e224096246b9c43fee3b3e44
parent2405ad659e2596b17c88e7b950c086159d06cc6e (diff)
downloadbusybox-4ebaf1074218d4e1c2907114bc53080c5abbd57d.tar.gz
strdup -> xstrdup
sed: de-obfuscate piece of code
-rw-r--r--editors/sed.c7
-rw-r--r--libbb/loop.c2
-rw-r--r--networking/udhcp/files.c2
3 files changed, 6 insertions, 5 deletions
diff --git a/editors/sed.c b/editors/sed.c
index 674381b56..720d29aed 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -175,12 +175,13 @@ static void parse_escapes(char *dest, char *string, int len, char from, char to)
while (i < len) {
if (string[i] == '\\') {
if (!to || string[i+1] == from) {
- *(dest++) = to ? to : string[i+1];
+ *dest++ = to ? to : string[i+1];
i += 2;
continue;
- } else *(dest++) = string[i++];
+ }
+ *dest++ = string[i++];
}
- *(dest++) = string[i++];
+ *dest++ = string[i++];
}
*dest = 0;
}
diff --git a/libbb/loop.c b/libbb/loop.c
index 14835ec24..9818a30cb 100644
--- a/libbb/loop.c
+++ b/libbb/loop.c
@@ -142,7 +142,7 @@ try_again:
}
close(ffd);
if (!rc) {
- if (!*device) *device = strdup(dev);
+ if (!*device) *device = xstrdup(dev);
return mode==O_RDONLY ? 1 : 0;
}
return rc;
diff --git a/networking/udhcp/files.c b/networking/udhcp/files.c
index 5e399e1f8..9ade4ae6d 100644
--- a/networking/udhcp/files.c
+++ b/networking/udhcp/files.c
@@ -56,7 +56,7 @@ static int read_str(const char *line, void *arg)
char **dest = arg;
free(*dest);
- *dest = strdup(line);
+ *dest = xstrdup(line);
return 1;
}