summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-09-25 12:16:30 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2009-09-25 13:33:57 +0200
commit0a0920af28e8eddf96314c85ca1cbcbc09f440d8 (patch)
tree71a58c32ee9a376f452b98e7f4854c4688579ae8 /lib
parenta205b87fa241ebe165da059617007c9263f33d2e (diff)
downloadbarebox-0a0920af28e8eddf96314c85ca1cbcbc09f440d8.tar.gz
barebox-0a0920af28e8eddf96314c85ca1cbcbc09f440d8.tar.xz
add xstrdup function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/xfuncs.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/xfuncs.c b/lib/xfuncs.c
index 426484be28..01a64cf5eb 100644
--- a/lib/xfuncs.c
+++ b/lib/xfuncs.c
@@ -60,3 +60,13 @@ void *xzalloc(size_t size)
}
EXPORT_SYMBOL(xzalloc);
+char *xstrdup(const char *s)
+{
+ char *p = strdup(s);
+
+ if (!p)
+ panic("ERROR: out of memory\n");
+ return p;
+}
+EXPORT_SYMBOL(xstrdup);
+