diff options
author | David Hows <howsdav@gmail.com> | 2016-01-18 10:54:11 +1100 |
---|---|---|
committer | David Hows <howsdav@gmail.com> | 2016-01-18 11:04:57 +1100 |
commit | cf1609c25e0bacef11846b78fbe150f0270e7337 (patch) | |
tree | 5c7c8b5ddc99ee71b131877559653c062f655d87 /bench | |
parent | 3b51510d7bb62371bb008428f40709226ccfac63 (diff) | |
download | mongo-cf1609c25e0bacef11846b78fbe150f0270e7337.tar.gz |
WT-2326 - Switch from dstrdup to dcalloc and strndup
Diffstat (limited to 'bench')
-rw-r--r-- | bench/wtperf/config.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/bench/wtperf/config.c b/bench/wtperf/config.c index 0b2fa8df6f1..5d77d11e2e9 100644 --- a/bench/wtperf/config.c +++ b/bench/wtperf/config.c @@ -442,12 +442,11 @@ config_opt(CONFIG *cfg, WT_CONFIG_ITEM *k, WT_CONFIG_ITEM *v) } strp = (char **)valueloc; free(*strp); - newstr = dstrdup(v->str); /* - * We add a nullbyte to this string to truncate the - * trailing quotation mark. + * We duplicate the string to len rather than len+1 as we want + * to truncate the trailing quotation mark. */ - newstr[v->len] = '\0'; + newstr = strndup(v->str, v->len); *strp = newstr; break; } |