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: bf8812cd7e20 ("dpctl: Add add/mod/del-flows command.")
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
return command;
}
- *flow = strndup(line, len);
+ *flow = xzalloc(len + 1);
+ ovs_strlcpy(*flow, line, len + 1);
line += len;
line += strspn(line, " \t\r\n");