diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2016-04-11 16:52:10 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-04-15 12:21:45 +0200 |
commit | 947fb5adf8af450507c978abf1c7ec9f051e5842 (patch) | |
tree | af790669292308b56baf188611ac430012037cba /lib/libfile.c | |
parent | 48b205e32342fc8a2648b2bd3f1f6d9a7d74e6cb (diff) | |
download | barebox-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 'lib/libfile.c')
-rw-r--r-- | lib/libfile.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libfile.c b/lib/libfile.c index 2c72ffe066..62e9b8ed22 100644 --- a/lib/libfile.c +++ b/lib/libfile.c @@ -91,7 +91,7 @@ char *read_file_line(const char *fmt, ...) struct stat s; va_start(args, fmt); - filename = vasprintf(fmt, args); + filename = bvasprintf(fmt, args); va_end(args); ret = stat(filename, &s); @@ -359,8 +359,8 @@ int copy_recursive(const char *src, const char *dst) if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, "..")) continue; - from = asprintf("%s/%s", src, d->d_name); - to = asprintf("%s/%s", dst, d->d_name); + from = basprintf("%s/%s", src, d->d_name); + to = basprintf("%s/%s", dst, d->d_name); ret = copy_recursive(from, to); if (ret) break; |