]> git.ipfire.org Git - thirdparty/iw.git/blobdiff - vendor.c
iw: add helpful hints for vendor cmd
[thirdparty/iw.git] / vendor.c
index d0b4f9ef4d5cc966b639b0141622fb9c91fa20f2..86c03d1c5f63a09180be405d5e0f2be4eac1556f 100644 (file)
--- a/vendor.c
+++ b/vendor.c
@@ -55,15 +55,19 @@ static int handle_vendor(struct nl80211_state *state,
        FILE *file = NULL;
 
        if (argc < 3)
-               return -EINVAL;
+               return 1;
 
        res = sscanf(argv[0], "0x%x", &oui);
-       if (res != 1)
-               return -EINVAL;
+       if (res != 1) {
+               printf("Vendor command must start with 0x\n");
+               return 2;
+       }
 
        res = sscanf(argv[1], "0x%x", &subcmd);
-       if (res != 1)
-               return -EINVAL;
+       if (res != 1) {
+               printf("Sub command must start with 0x\n");
+               return 2;
+       }
 
        if (!strcmp(argv[2], "-"))
                file = stdin;