diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-08-14 00:29:06 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-08-14 00:29:06 +0200 |
commit | c8571c61ec4c352e7eac7147b7c1644d2406189e (patch) | |
tree | 7b30d14ae332d5b9d5b79ba257cc2833d28e3855 /libavutil/mem.h | |
parent | 097bf149c92aeae8af7f3559878e046a047e892d (diff) | |
parent | 8ddc32629a6d6be77256694c9e322dde134609f3 (diff) | |
download | ffmpeg-c8571c61ec4c352e7eac7147b7c1644d2406189e.tar.gz |
Merge commit '8ddc32629a6d6be77256694c9e322dde134609f3'
* commit '8ddc32629a6d6be77256694c9e322dde134609f3':
mem: add av_strndup() for duplicating substrings
Conflicts:
libavutil/mem.c
libavutil/mem.h
libavutil/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/mem.h')
-rw-r--r-- | libavutil/mem.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavutil/mem.h b/libavutil/mem.h index 0be2127071..2a1e36d69f 100644 --- a/libavutil/mem.h +++ b/libavutil/mem.h @@ -241,6 +241,16 @@ av_alloc_size(1, 2) static inline void *av_mallocz_array(size_t nmemb, size_t si char *av_strdup(const char *s) av_malloc_attrib; /** + * Duplicate a substring of the string s. + * @param s string to be duplicated + * @param len the maximum length of the resulting string (not counting the + * terminating byte). + * @return Pointer to a newly-allocated string containing a + * copy of s or NULL if the string cannot be allocated. + */ +char *av_strndup(const char *s, size_t len) av_malloc_attrib; + +/** * Duplicate the buffer p. * @param p buffer to be duplicated * @return Pointer to a newly allocated buffer containing a |