changeset 16854:3898e1089a29

fix incorrect use of strl* functions (patch by reimar) (unknown suboption "cop" with -oac copy, etc)
author rfelker
date Tue, 25 Oct 2005 17:28:10 +0000
parents da29ac12242d
children 5f83daf94eb2
files m_option.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/m_option.c	Tue Oct 25 17:13:20 2005 +0000
+++ b/m_option.c	Tue Oct 25 17:28:10 2005 +0000
@@ -886,7 +886,7 @@
       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 @@
         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 @@
             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];
         }
       }