examples: fix port mask parsing failure handling
[dpdk.git] / examples / l3fwd-acl / main.c
index cccf819..112ec3d 100644 (file)
@@ -1567,10 +1567,7 @@ parse_portmask(const char *portmask)
        /* parse hexadecimal string */
        pm = strtoul(portmask, &end, 16);
        if ((portmask[0] == '\0') || (end == NULL) || (*end != '\0'))
-               return -1;
-
-       if (pm == 0)
-               return -1;
+               return 0;
 
        return pm;
 }
@@ -1839,7 +1836,7 @@ check_all_ports_link_status(uint32_t port_mask)
                                        "Port%d Link Up. Speed %u Mbps %s\n",
                                                portid, link.link_speed,
                                (link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
-                                       ("full-duplex") : ("half-duplex\n"));
+                                       ("full-duplex") : ("half-duplex"));
                                else
                                        printf("Port %d Link Down\n", portid);
                                continue;