Semicolons and pointers

This commit is contained in:
Steven Tracey 2024-11-22 11:46:05 -05:00
parent c1af7cbed3
commit 0abc7946c1

View File

@ -124,11 +124,11 @@ void config(UWORD *blackImage, char* configName) {
if (ch == 'q') return; if (ch == 'q') return;
} }
void drawTotpHome(UWORD *blackImage, char** configNames) { void drawTotpHome(UWORD *blackImage, char** configNames, int *length) {
Paint_NewImage(blackImage, EPD_2in13_V4_WIDTH, EPD_2in13_V4_HEIGHT, 0, WHITE); Paint_NewImage(blackImage, EPD_2in13_V4_WIDTH, EPD_2in13_V4_HEIGHT, 0, WHITE);
Paint_SelectImage(blackImage); Paint_SelectImage(blackImage);
Paint_Clear(WHITE); Paint_Clear(WHITE);
for (int j = 0; j < length; j++) { for (int j = 0; j < *length; j++) {
if (configNames[j] == NULL) { if (configNames[j] == NULL) {
DebugLine(13, 0, "Null Config: %d\n", j); DebugLine(13, 0, "Null Config: %d\n", j);
} }
@ -151,7 +151,7 @@ void totpHome(UWORD *blackImage) {
return; return;
} }
drawTotpHome(blackImage, configNames); drawTotpHome(blackImage, configNames, &length);
int i = 0; int i = 0;
Paint_DrawString(115, 5 + (i * 20), "<", &Font12, WHITE, BLACK); Paint_DrawString(115, 5 + (i * 20), "<", &Font12, WHITE, BLACK);
@ -174,11 +174,11 @@ void totpHome(UWORD *blackImage) {
case '\n': case '\n':
timeout(0); timeout(0);
code(blackImage, configNames[i]); code(blackImage, configNames[i]);
drawTotpHome(blackImage, configNames); drawTotpHome(blackImage, configNames, &length);
break; break;
case 'c': case 'c':
config(blackImage, configNames[i]); config(blackImage, configNames[i]);
drawTotpHome(blackImage, configNames); drawTotpHome(blackImage, configNames, &length);
break; break;
case 'q': case 'q':
return; return;
@ -216,7 +216,7 @@ int drawLoop() {
int main() { int main() {
signal(SIGINT, Handler); signal(SIGINT, Handler);
signal(SIGTERM, Handler) signal(SIGTERM, Handler);
initscr(); initscr();
cbreak(); cbreak();