aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/avstring.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-25 14:36:45 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-25 14:36:45 +0100
commit25be63005f0ba0b4cb8bf2569202ad0e89b4dae3 (patch)
tree43bf6b49aa89942207f0937cfcab374524795a8f /libavutil/avstring.c
parentb2d0c5bd13ab100a3acb18e9c869d73904e6e764 (diff)
parentb85a5e87af4254b80913fe33591d96361f30832b (diff)
downloadffmpeg-25be63005f0ba0b4cb8bf2569202ad0e89b4dae3.tar.gz
Merge commit 'b85a5e87af4254b80913fe33591d96361f30832b'
* commit 'b85a5e87af4254b80913fe33591d96361f30832b': lavu: Add av_strnstr() h264: Allow discarding the cropping information from SPS Conflicts: Changelog doc/APIchanges libavcodec/avcodec.h libavcodec/version.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/avstring.c')
-rw-r--r--libavutil/avstring.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavutil/avstring.c b/libavutil/avstring.c
index b47fe535ce..2f00374176 100644
--- a/libavutil/avstring.c
+++ b/libavutil/avstring.c
@@ -65,6 +65,20 @@ char *av_stristr(const char *s1, const char *s2)
return NULL;
}
+char *av_strnstr(const char *haystack, const char *needle, size_t hay_length)
+{
+ size_t needle_len = strlen(needle);
+ if (!needle_len)
+ return haystack;
+ while (hay_length >= needle_len) {
+ hay_length--;
+ if (!memcmp(haystack, needle, needle_len))
+ return haystack;
+ haystack++;
+ }
+ return NULL;
+}
+
size_t av_strlcpy(char *dst, const char *src, size_t size)
{
size_t len = 0;