From: Alan T. DeKok Date: Mon, 18 Feb 2013 21:14:07 +0000 (-0500) Subject: Older systems don't have strlcpy X-Git-Tag: release_3_0_0_beta1~1033 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98d39b2fe150c5b36a7afdb75ae2552ecd714394;p=thirdparty%2Ffreeradius-server.git Older systems don't have strlcpy --- diff --git a/scripts/jlibtool.c b/scripts/jlibtool.c index b0bc2ae21a2..1c8cd0ea9a2 100644 --- a/scripts/jlibtool.c +++ b/scripts/jlibtool.c @@ -651,7 +651,8 @@ static int parse_long_opt(char *arg, command_t *cmd_data) if (equal_pos) { strncpy(var, arg, equal_pos - arg); var[equal_pos - arg] = 0; - strlcpy(value, equal_pos + 1, sizeof(var)); + if (strlen(equal_pos + 1) >= sizeof(var)) return 0; + strcpy(value, equal_pos + 1); } else { strncpy(var, arg, sizeof(var) - 1); var[sizeof(var) - 1] = '\0';