ssb-sprom: Fix typo.
[b43-tools.git] / ssb_sprom / ssb_sprom.c
index facacab9f643f0ca9762908f79ce2f0f9610e9c4..ee56d38ed9febfedf3b31129a0fada51b9cc258c 100644 (file)
@@ -574,7 +574,7 @@ static void display_value(const uint8_t *sprom,
        case VALUE_ANTGA:
                if (sprom_rev != 4) {
                        desc = "A PHY antenna gain";
-                       offset = SPROM_ANTENNA_GAIN + 1;
+                       offset = SPROM_ANTENNA_GAIN;
                } else {
                        desc = "Antenna 1 Gain";
                        offset = SPROM4_ANTENNA_GAIN;
@@ -1016,12 +1016,12 @@ static int do_cmp_arg(char **argv, int *pos,
        }
        if (strcmp(arg, template) == 0) {
                if (param) {
-                       /* Skip the parameter on the next iteration. */
-                       (*pos)++;
                        if (*param == 0) {
                                prerror("%s needs a parameter\n", arg);
                                return ARG_ERROR;
                        }
+                       /* Skip the parameter on the next iteration. */
+                       (*pos)++;
                }
                return ARG_MATCH;
        }
@@ -1511,7 +1511,8 @@ static int parse_args(int argc, char *argv[])
                        if (err)
                                goto error;
                } else {
-                       prerror("Unrecognized argument: %s\n", argv[i]);
+                       if (!parse_err)
+                               prerror("Unrecognized argument: %s\n", argv[i]);
                        goto out_usage;
                }
                if (parse_err)