Without having access to the source, it was
hard to know the format of vendor oui and sub
cmd. This commit fixes that by returning the
right error code to print the help text.
Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
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;