From: Wouter Wijngaards Date: Fri, 16 Apr 2010 09:16:58 +0000 (+0000) Subject: no more strcpy in ldns-dpa X-Git-Tag: release-1.6.5~37 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ef0b8143cec4f80bd7fbc63febb5873978ad047e;p=thirdparty%2Fldns.git no more strcpy in ldns-dpa --- diff --git a/examples/ldns-dpa.c b/examples/ldns-dpa.c index 6e0e98b9..1d761327 100644 --- a/examples/ldns-dpa.c +++ b/examples/ldns-dpa.c @@ -1850,8 +1850,7 @@ parse_match_expression(char *string) val = malloc(4); snprintf(val, 3, "%u", (unsigned int) lt->id); } else { - val = malloc(strlen(str) - i + 1); - strcpy(val, &str[i]); + val = strdup(&str[i]); } break; case TYPE_RCODE: @@ -1860,13 +1859,11 @@ parse_match_expression(char *string) val = malloc(4); snprintf(val, 3, "%u", (unsigned int) lt->id); } else { - val = malloc(strlen(str) - i + 1); - strcpy(val, &str[i]); + val = strdup(&str[i]); } break; default: - val = malloc(strlen(str) - i + 1); - strcpy(val, &str[i]); + val = strdup(&str[i]); break; } mo->value = val;