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.")
Signed-off-by: Ilya Maximets <[email protected]>
---

Successful Windows build:
  https://ci.appveyor.com/project/igsilya/ovs/builds/37137791

 lib/dpctl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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");
-- 
2.25.4

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to