ofp-print: Avoid converting flow to ofp_match just to format it.
[openvswitch] / lib / nx-match.c
index 12ea4fb8c520f9b2f2e8cd5f2b8bd0c595b80005..9f869a765acdcd4d17ee496204dc141f5f940f74 100644 (file)
@@ -747,17 +747,15 @@ static const char *
 parse_hex_bytes(struct ofpbuf *b, const char *s, unsigned int n)
 {
     while (n--) {
-        int low, high;
         uint8_t byte;
+        bool ok;
 
         s += strspn(s, " ");
-        low = hexit_value(*s);
-        high = low < 0 ? low : hexit_value(s[1]);
-        if (low < 0 || high < 0) {
+        byte = hexits_value(s, 2, &ok);
+        if (!ok) {
             ovs_fatal(0, "%.2s: hex digits expected", s);
         }
 
-        byte = 16 * low + high;
         ofpbuf_put(b, &byte, 1);
         s += 2;
     }