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>
This commit is contained in:
Michael Niedermayer
2014-08-14 00:29:06 +02:00
4 changed files with 34 additions and 1 deletions
+10
View File
@@ -240,6 +240,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