classifier: Rewrite.
[openvswitch] / lib / ofp-parse.c
index 7a888801e7159043743f2baf244ef4a214e49178..d563a4e440efc3d24f7611070c418d7ec0cd7e25 100644 (file)
@@ -21,6 +21,7 @@
 #include <errno.h>
 #include <stdlib.h>
 
+#include "byte-order.h"
 #include "dynamic-string.h"
 #include "netdev.h"
 #include "ofp-util.h"
@@ -30,9 +31,8 @@
 #include "socket-util.h"
 #include "vconn.h"
 #include "vlog.h"
-#include "xtoxll.h"
 
-VLOG_DEFINE_THIS_MODULE(ofp_parse)
+VLOG_DEFINE_THIS_MODULE(ofp_parse);
 
 static uint32_t
 str_to_u32(const char *str)
@@ -40,6 +40,10 @@ str_to_u32(const char *str)
     char *tail;
     uint32_t value;
 
+    if (!str) {
+        ovs_fatal(0, "missing required numeric argument");
+    }
+
     errno = 0;
     value = strtoul(str, &tail, 0);
     if (errno == EINVAL || errno == ERANGE || *tail) {