Commit 943d5fed authored by philipjsg's avatar philipjsg

* Add implementation of strlcpy

* Fix endless loop in find_info_tag if given specific arguments


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@481 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 828d1c5e
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment