dpctl: Fix broken Windows build due to missing strndup.
AppVeyor reports:
lib/dpctl.c(1433): error C4013: 'strndup' undefined;
assuming extern returning int
make[2]: *** [lib/dpctl.lo] Error 1
Replacing missing 'strndup' with a portable pair of functions.
Fixes: ("dpctl: Add add/mod/del-flows command.")
Acked-by: Eelco Chaudron
@@ -1430,7 +1430,8 @@ dpctl_parse_flow_line(int command, struct ds *s, char **flow, char **action)
return command;
}
- *flow = strndup(line, len);
+ *flow = xzalloc(len + 1);
+ ovs_strlcpy(*flow, line, len + 1);
line += len;
line += strspn(line, " \t\r\n");
