timekeeper

[Abandoned unfinished] CGI web application in C for time tracking. (My first, just a learning project)
Log | Files | Refs | README

commit 8be5b06171e57cfffce26d8020015ffab452b35b
parent 0a4f889ba87bd4a88286ae8b451ecb5311dc0497
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date:   Sun, 10 Mar 2024 22:12:13 -0700

Fix improper usage of <th> element

I wasn't aware that <th> was for header cells and that <td> existed
for cell data. Now cells with data use the appropriate element.

Diffstat:
Mpages/main.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pages/main.c b/pages/main.c @@ -162,7 +162,7 @@ printtime(struct pagedata *pd, time_t *times, unsigned int len) for (i = 0; i < 4; ++i) { if (i >= len || !times[i]) { - if ((status = khtml_elem(&pd->html, KELEM_TH)) != KCGI_OK) + if ((status = khtml_elem(&pd->html, KELEM_TD)) != KCGI_OK) return status; if (len == StartTime && i == StartTime) @@ -189,7 +189,7 @@ printtime(struct pagedata *pd, time_t *times, unsigned int len) strftime(time, sizeof(time), "%R", tm) >= sizeof(time)) return KCGI_SYSTEM; - if ((status = khtml_elem(&pd->html, KELEM_TH)) != KCGI_OK || + if ((status = khtml_elem(&pd->html, KELEM_TD)) != KCGI_OK || (status = khtml_attr(&pd->html, KELEM_TIME, KATTR_DATETIME, datetime, KATTR__MAX)) != KCGI_OK || (status = khtml_puts(&pd->html, time)) != KCGI_OK || @@ -197,7 +197,7 @@ printtime(struct pagedata *pd, time_t *times, unsigned int len) return status; } - if ((status = khtml_elem(&pd->html, KELEM_TH)) != KCGI_OK || + if ((status = khtml_elem(&pd->html, KELEM_TD)) != KCGI_OK || (len && (status = printhours(pd, times, len)) != KCGI_OK) || (status = khtml_closeelem(&pd->html, 1)) != KCGI_OK) return status;