From 97f2d88db08c2f079f522d315ff4f78f88d9f74a Mon Sep 17 00:00:00 2001 From: rfelker Date: Tue, 25 Oct 2005 17:28:10 +0000 Subject: [PATCH] fix incorrect use of strl* functions (patch by reimar) (unknown suboption "cop" with -oac copy, etc) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16855 b3059339-0415-0410-9bf9-f77b7e298cf2 --- m_option.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/m_option.c b/m_option.c index e595d0bb84..3601e2d4f0 100644 --- a/m_option.c +++ b/m_option.c @@ -886,7 +886,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); + strlcpy(subopt, p, optlen + 1); p = &p[optlen]; if (p[0] == '=') { sscanf_ret = 2; @@ -894,7 +894,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); + strlcpy(subparam, p, optlen + 1); p = &p[optlen]; if (p[0] != '"') { mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Terminating '\"' missing for '%s'\n", subopt); @@ -909,11 +909,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); + strlcpy(subparam, p, optlen + 1); p = &p[optlen]; } else { optlen = strcspn(p, ":"); - strlcpy(subparam, p, optlen); + strlcpy(subparam, p, optlen + 1); p = &p[optlen]; } }