summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/ffmpeg/libavutil/avstring.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/ffmpeg/libavutil/avstring.h')
-rw-r--r--chromium/third_party/ffmpeg/libavutil/avstring.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/chromium/third_party/ffmpeg/libavutil/avstring.h b/chromium/third_party/ffmpeg/libavutil/avstring.h
index 882a2b57dc2..de2f71d12b6 100644
--- a/chromium/third_party/ffmpeg/libavutil/avstring.h
+++ b/chromium/third_party/ffmpeg/libavutil/avstring.h
@@ -132,6 +132,20 @@ size_t av_strlcat(char *dst, const char *src, size_t size);
size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) av_printf_format(3, 4);
/**
+ * Get the count of continuous non zero chars starting from the beginning.
+ *
+ * @param len maximum number of characters to check in the string, that
+ * is the maximum value which is returned by the function
+ */
+static inline size_t av_strnlen(const char *s, size_t len)
+{
+ size_t i;
+ for (i = 0; i < len && s[i]; i++)
+ ;
+ return i;
+}
+
+/**
* Print arguments following specified format into a large enough auto
* allocated buffer. It is similar to GNU asprintf().
* @param fmt printf-compatible format string, specifying how the