minmea_scan: avoid shadowing local variables
This commit is contained in:
parent
d19839cc7e
commit
2329d55ff6
12
minmea.c
12
minmea.c
@ -221,8 +221,8 @@ bool minmea_scan(const char *sentence, const char *format, ...)
|
||||
|
||||
if (field[0] != '$')
|
||||
goto parse_error;
|
||||
for (int i=0; i<5; i++)
|
||||
if (!minmea_isfield(field[1+i]))
|
||||
for (int f=0; f<5; f++)
|
||||
if (!minmea_isfield(field[f+i]))
|
||||
goto parse_error;
|
||||
|
||||
char *buf = va_arg(ap, char *);
|
||||
@ -237,8 +237,8 @@ bool minmea_scan(const char *sentence, const char *format, ...)
|
||||
|
||||
if (field && minmea_isfield(*field)) {
|
||||
// Always six digits.
|
||||
for (int i=0; i<6; i++)
|
||||
if (!isdigit((unsigned char) field[i]))
|
||||
for (int f=0; f<6; f++)
|
||||
if (!isdigit((unsigned char) field[f]))
|
||||
goto parse_error;
|
||||
|
||||
d = strtol((char[]) {field[0], field[1], '\0'}, NULL, 10);
|
||||
@ -258,8 +258,8 @@ bool minmea_scan(const char *sentence, const char *format, ...)
|
||||
|
||||
if (field && minmea_isfield(*field)) {
|
||||
// Minimum required: integer time.
|
||||
for (int i=0; i<6; i++)
|
||||
if (!isdigit((unsigned char) field[i]))
|
||||
for (int f=0; f<6; f++)
|
||||
if (!isdigit((unsigned char) field[f]))
|
||||
goto parse_error;
|
||||
|
||||
h = strtol((char[]) {field[0], field[1], '\0'}, NULL, 10);
|
||||
|
Loading…
Reference in New Issue
Block a user