projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2833837
)
* Add implementation of strlcpy
author
Philip Gladstone
<philipjsg@users.sourceforge.net>
Fri, 10 May 2002 02:17:41 +0000
(
02:17
+0000)
committer
Philip Gladstone
<philipjsg@users.sourceforge.net>
Fri, 10 May 2002 02:17:41 +0000
(
02:17
+0000)
* Fix endless loop in find_info_tag if given specific arguments
Originally committed as revision 481 to svn://svn.ffmpeg.org/ffmpeg/trunk
libav/utils.c
patch
|
blob
|
history
diff --git
a/libav/utils.c
b/libav/utils.c
index 8520656a1b5bed167cc4afec29e9849eea84991d..161e72ceef34d49bdda3a454d26db5601a73a998 100644
(file)
--- a/
libav/utils.c
+++ b/
libav/utils.c
@@
-124,6
+124,18
@@
void nstrcpy(char *buf, int buf_size, const char *str)
*q = '\0';
}
+void strlcpy(char *dst, const char *src, int len)
+{
+ int slen = strlen(src) + 1;
+
+ if (slen <= len) {
+ memcpy(dst, src, slen);
+ } else {
+ memcpy(dst, src, len - 1);
+ dst[len - 1] = 0;
+ }
+}
+
void register_all(void)
{
avcodec_init();
@@
-561,6
+573,7
@@
int find_info_tag(char *arg, int arg_size, const char *tag1, const char *info)
return 1;
if (*p != '&')
break;
+ p++;
}
return 0;
}