diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2014-05-10 11:48:34 +0200 |
---|---|---|
committer | Clemens Ladisch <clemens@ladisch.de> | 2014-05-10 11:48:34 +0200 |
commit | 11dbe737be8488d76ee26fb5726a2a5ea9e3237f (patch) | |
tree | 2a122c5e10f7e92a7b0544a101674acf3d2ed23a | |
parent | 70799310a7bf7a43e1c8579026fd73810b45dc88 (diff) | |
download | linux-firewire-utils-11dbe737be8488d76ee26fb5726a2a5ea9e3237f.tar.gz |
lsfirewirephy: fix option parsing
Catch the phy-id parameter being an empty string.
-rw-r--r-- | src/lsfirewirephy.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lsfirewirephy.c b/src/lsfirewirephy.c index 239c17e..a66360c 100644 --- a/src/lsfirewirephy.c +++ b/src/lsfirewirephy.c @@ -232,7 +232,7 @@ static void parse_parameters(int argc, char *argv[]) if (optind < argc) { list_phy_id = strtol(argv[optind], &endptr, 0); - if (argv[optind][0] != '\0' && *endptr != '\0') + if (argv[optind][0] == '\0' || *endptr != '\0') goto syntax_error; if (list_phy_id < 0 || list_phy_id >= 63) { fputs("phy-id must be between 0 and 62\n", stderr); |