summaryrefslogtreecommitdiffstats
path: root/common/environment.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-04-11 16:52:10 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-04-15 12:21:45 +0200
commit947fb5adf8af450507c978abf1c7ec9f051e5842 (patch)
treeaf790669292308b56baf188611ac430012037cba /common/environment.c
parent48b205e32342fc8a2648b2bd3f1f6d9a7d74e6cb (diff)
downloadbarebox-947fb5adf8af450507c978abf1c7ec9f051e5842.tar.gz
barebox-947fb5adf8af450507c978abf1c7ec9f051e5842.tar.xz
string: Fix (v)asprintf prototypes
Our asprintf and vasprintf have different prototypes than the glibc functions. This causes trouble when we want to share barebox code with userspace code. Change the prototypes for (v)asprintf to match the glibc prototypes. Since the current (v)asprintf are convenient to use change the existing functions to b(v)asprintf. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/environment.c')
-rw-r--r--common/environment.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/environment.c b/common/environment.c
index 65404afa14..fa6b59620e 100644
--- a/common/environment.c
+++ b/common/environment.c
@@ -80,7 +80,7 @@ static int do_compare_file(const char *filename, const char *base)
char *cmp;
const char *relname = filename + strlen(base) + 1;
- cmp = asprintf("%s/%s", TMPDIR, relname);
+ cmp = basprintf("%s/%s", TMPDIR, relname);
ret = compare_file(cmp, filename);
free(cmp);
@@ -193,7 +193,7 @@ static int file_remove_action(const char *filename, struct stat *statbuf,
filename += sizeof(TMPDIR) - 1;
- envname = asprintf("%s/%s", data->base, filename);
+ envname = basprintf("%s/%s", data->base, filename);
ret = stat(envname, &s);
if (ret) {