summaryrefslogtreecommitdiff
path: root/e2fsprogs
diff options
context:
space:
mode:
author"Vladimir N. Oleynik"2005-09-29 16:18:57 +0000
committer"Vladimir N. Oleynik"2005-09-29 16:18:57 +0000
commit39a841cecf616098c9c8cf63bbfea5ea2922097c (patch)
tree5b3a1d569d1e952d8c43899050dca4d6c47bf176 /e2fsprogs
parent6a60c821a81b01a136037f8389bd42d86b37e395 (diff)
downloadbusybox-39a841cecf616098c9c8cf63bbfea5ea2922097c.zip
busybox-39a841cecf616098c9c8cf63bbfea5ea2922097c.tar.gz
change interface to bb_xasprintf() - more perfect for me.
ln.c: error_msg(str)->error_msg(%s, str) - remove standart "feature" for hackers reduce 100 bytes don't care in sum
Diffstat (limited to 'e2fsprogs')
-rw-r--r--e2fsprogs/fsck.c13
-rw-r--r--e2fsprogs/mke2fs.c5
2 files changed, 7 insertions, 11 deletions
diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c
index bb334e3..93514a3 100644
--- a/e2fsprogs/fsck.c
+++ b/e2fsprogs/fsck.c
@@ -363,7 +363,6 @@ static char *find_fsck(char *type)
{
char *s;
const char *tpl;
- char *prog;
char *p = string_copy(fsck_path);
struct stat st;
@@ -371,12 +370,12 @@ static char *find_fsck(char *type)
tpl = (strncmp(type, "fsck.", 5) ? "%s/fsck.%s" : "%s/%s");
for(s = strtok(p, ":"); s; s = strtok(NULL, ":")) {
- bb_xasprintf(&prog, tpl, s, type);
- if (stat(prog, &st) == 0) break;
- free(prog);
+ s = bb_xasprintf(tpl, s, type);
+ if (stat(s, &st) == 0) break;
+ free(s);
}
free(p);
- return(s ? prog : NULL);
+ return(s);
}
static int progress_active(void)
@@ -410,7 +409,7 @@ static int execute(const char *type, const char *device, const char *mntpt,
return ENOMEM;
memset(inst, 0, sizeof(struct fsck_instance));
- bb_xasprintf(&prog, "fsck.%s", type);
+ prog = bb_xasprintf("fsck.%s", type);
argv[0] = prog;
argc = 1;
@@ -1189,7 +1188,7 @@ int fsck_main(int argc, char *argv[])
/* Update our search path to include uncommon directories. */
if (oldpath) {
- bb_xasprintf(&fsck_path, "%s:%s", fsck_prefix_path, oldpath);
+ fsck_path = bb_xasprintf("%s:%s", fsck_prefix_path, oldpath);
} else {
fsck_path = string_copy(fsck_prefix_path);
}
diff --git a/e2fsprogs/mke2fs.c b/e2fsprogs/mke2fs.c
index 017fb53..6cd5bd4 100644
--- a/e2fsprogs/mke2fs.c
+++ b/e2fsprogs/mke2fs.c
@@ -794,10 +794,7 @@ static int PRS(int argc, char *argv[])
/* Update our PATH to include /sbin */
if (oldpath) {
- char *newpath;
-
- bb_xasprintf(&newpath, "%s:%s", PATH_SET, oldpath);
- putenv(newpath);
+ putenv (bb_xasprintf("%s:%s", PATH_SET, oldpath));
} else
putenv (PATH_SET);