Don't call xstrlcpy() to truncate a string. It causes spurious xstrlcpy()
authorChristos Zoulas <christos@zoulas.com>
Sun, 11 Mar 2007 19:59:20 +0000 (19:59 +0000)
committerChristos Zoulas <christos@zoulas.com>
Sun, 11 Mar 2007 19:59:20 +0000 (19:59 +0000)
syslog() errors. Use memcpy() and explicitly terminate the string.

amd/opts.c

index 039d3c3a7dc44d87e0a93aae2ec99238d8f7386c..fc6a09ba5b432d65932e60babdf5250237b9cf0b 100644 (file)
@@ -1238,8 +1238,9 @@ expand_op(char *opt, int sel_p)
            }
 
            if (BUFSPACE(ep, vlen+1)) {
-             xstrlcpy(ep, vptr, vlen+1);
+             memcpy(ep, vptr, vlen+1);
              ep += vlen;
+             *ep = '\0';
            } else {
              plog(XLOG_ERROR, EXPAND_ERROR, opt);
              goto out;