]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Older systems don't have strlcpy
authorAlan T. DeKok <aland@freeradius.org>
Mon, 18 Feb 2013 21:14:07 +0000 (16:14 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 18 Feb 2013 21:15:05 +0000 (16:15 -0500)
scripts/jlibtool.c

index b0bc2ae21a289abf79ae4ecd64a4cd5051f293e2..1c8cd0ea9a2cfbc80263bb003e1b61b3cd034458 100644 (file)
@@ -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';