diff options
author | Ilya Maximets <i.maximets@ovn.org> | 2021-01-06 16:29:26 +0100 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2021-01-06 19:07:08 +0100 |
commit | 98b1d633c4125e395c08d3257b7352f3172d8c8f (patch) | |
tree | 95fe798a369ade87a56d7b774f9876d5a606c786 | |
parent | fe5ff26a49f61982a785fe8bf5739e739bf1bc00 (diff) | |
download | openvswitch-98b1d633c4125e395c08d3257b7352f3172d8c8f.tar.gz |
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: bf8812cd7e20 ("dpctl: Add add/mod/del-flows command.")
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
-rw-r--r-- | lib/dpctl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/dpctl.c b/lib/dpctl.c index 408f98075..d43e0a7fe 100644 --- a/lib/dpctl.c +++ b/lib/dpctl.c @@ -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"); |