summaryrefslogtreecommitdiffstats
path: root/m_option.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-07-05 22:01:07 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-07-05 22:01:07 +0000
commit4c4a1070febe5a140cac0357267af338b9852a7e (patch)
treed7ed87a85da0733f33ea47c25797f58c25e5e9fc /m_option.c
parentb3d59ea908ce87b3dc50bb9ba0ac81edd4765797 (diff)
downloadmpv-4c4a1070febe5a140cac0357267af338b9852a7e.tar.bz2
mpv-4c4a1070febe5a140cac0357267af338b9852a7e.tar.xz
Avoid code duplication and ugly config.h hack by using av_strlcat/av_strlcpy
instead of plain strlcat/strlcpy git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23723 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'm_option.c')
-rw-r--r--m_option.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/m_option.c b/m_option.c
index cab7184a15..d63ba0ac83 100644
--- a/m_option.c
+++ b/m_option.c
@@ -16,6 +16,7 @@
//#include "m_config.h"
#include "mp_msg.h"
#include "stream/url.h"
+#include "libavutil/avstring.h"
// Don't free for 'production' atm
#ifndef MP_DEBUG
@@ -920,7 +921,7 @@ static int parse_subconf(m_option_t* opt,char *name, char *param, void* dst, int
int optlen = strcspn(p, ":=");
/* clear out */
subopt[0] = subparam[0] = 0;
- strlcpy(subopt, p, optlen + 1);
+ av_strlcpy(subopt, p, optlen + 1);
p = &p[optlen];
if (p[0] == '=') {
sscanf_ret = 2;
@@ -928,7 +929,7 @@ static int parse_subconf(m_option_t* opt,char *name, char *param, void* dst, int
if (p[0] == '"') {
p = &p[1];
optlen = strcspn(p, "\"");
- strlcpy(subparam, p, optlen + 1);
+ av_strlcpy(subparam, p, optlen + 1);
p = &p[optlen];
if (p[0] != '"') {
mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Terminating '\"' missing for '%s'\n", subopt);
@@ -943,11 +944,11 @@ static int parse_subconf(m_option_t* opt,char *name, char *param, void* dst, int
return M_OPT_INVALID;
}
p = &p[1];
- strlcpy(subparam, p, optlen + 1);
+ av_strlcpy(subparam, p, optlen + 1);
p = &p[optlen];
} else {
optlen = strcspn(p, ":");
- strlcpy(subparam, p, optlen + 1);
+ av_strlcpy(subparam, p, optlen + 1);
p = &p[optlen];
}
}