uint16_t for seperator, for those madmans out ther

This commit is contained in:
Linus Dierheimer
2021-02-20 20:12:57 +01:00
parent e3616d8b72
commit 11b5d6e138
3 changed files with 4 additions and 10 deletions
+2 -8
View File
@@ -210,17 +210,11 @@ int main(int argc, char** argv)
printf("Error: usage: %s <width>\n", argv[i]);
return 44;
}
size_t len = strlen(argv[i + 1]);
if(len > 3)
if(sscanf(argv[i + 1], "%hd", &state.logo_seperator) != 1)
{
printf("Error: max seperator length is 3 digits (up to 255), %zu given\n", len);
printf("Error: couldn't parse %s to uint16_t\n", argv[i + 1]);
return 45;
}
if(sscanf(argv[i + 1], "%2hhx", &state.logo_seperator) != 1)
{
printf("Error: couldn't parse %s to uint8_t\n", argv[i + 1]);
return 46;
}
++i;
}
else
+1 -1
View File
@@ -34,7 +34,7 @@ typedef struct FFstate
FFlogo logo;
uint8_t logo_seperator;
uint16_t logo_seperator;
char color[10];
bool showErrors;
+1 -1
View File
@@ -115,7 +115,7 @@ void ffPrintLogoLine(FFstate* state)
putchar(' ');
}
for(uint8_t i = 0; i < state->logo_seperator; i++)
for(uint16_t i = 0; i < state->logo_seperator; i++)
putchar(' ');
++state->current_row;