diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2020-10-25 10:41:18 +0100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2022-01-25 17:10:47 +1100 |
commit | 651410e54cb9a478f2fbb16cb493a5e7808ad8fe (patch) | |
tree | 0b4467d024918934e1780548986983a78602d727 /util.h | |
parent | 4048aed12b81c5a0154b9af438edc99ec7d2b6a1 (diff) | |
download | dtc-651410e54cb9a478f2fbb16cb493a5e7808ad8fe.zip dtc-651410e54cb9a478f2fbb16cb493a5e7808ad8fe.tar.gz dtc-651410e54cb9a478f2fbb16cb493a5e7808ad8fe.tar.bz2 |
util: introduce xstrndup helper
We already have xstrdup, add xstrndup as well to make it
straight-forward to clone part of a string.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -61,6 +61,7 @@ static inline void *xrealloc(void *p, size_t len) } extern char *xstrdup(const char *s); +extern char *xstrndup(const char *s, size_t len); extern int PRINTF(2, 3) xasprintf(char **strp, const char *fmt, ...); extern int PRINTF(2, 3) xasprintf_append(char **strp, const char *fmt, ...); |