summaryrefslogtreecommitdiffstats
path: root/fs/uimagefs.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 /fs/uimagefs.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 'fs/uimagefs.c')
-rw-r--r--fs/uimagefs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/uimagefs.c b/fs/uimagefs.c
index c2e34a7f32..13c1fbac05 100644
--- a/fs/uimagefs.c
+++ b/fs/uimagefs.c
@@ -250,7 +250,7 @@ static int uimagefs_add_name(struct uimagefs_handle *priv)
static int uimagefs_add_hex(struct uimagefs_handle *priv, enum uimagefs_type type,
uint32_t data)
{
- char *val = asprintf("0x%x", data);
+ char *val = basprintf("0x%x", data);
return uimagefs_add_str(priv, type, val);
}
@@ -266,7 +266,7 @@ static int __uimagefs_add_data(struct uimagefs_handle *priv, size_t offset,
if (i < 0)
d->name = xstrdup(name);
else
- d->name = asprintf("%s%d", name, i);
+ d->name = basprintf("%s%d", name, i);
d->offset = offset;
d->size = size;
@@ -304,7 +304,7 @@ static int uimagefs_add_time(struct uimagefs_handle *priv)
char *val;
to_tm(header->ih_time, &tm);
- val = asprintf("%4d-%02d-%02d %2d:%02d:%02d UTC",
+ val = basprintf("%4d-%02d-%02d %2d:%02d:%02d UTC",
tm.tm_year, tm.tm_mon, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec);
@@ -515,8 +515,8 @@ static int uimagefs_probe(struct device_d *dev)
dev_dbg(dev, "mount: %s\n", fsdev->backingstore);
if (IS_BUILTIN(CONFIG_FS_TFTP))
- priv->tmp = asprintf("/.uImage_tmp_%08x",
- crc32(0, fsdev->path, strlen(fsdev->path)));
+ priv->tmp = basprintf("/.uImage_tmp_%08x",
+ crc32(0, fsdev->path, strlen(fsdev->path)));
ret = __uimage_open(priv);
if (ret)