diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a76778..c8459d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ 2026.07.19 – Fix !weather returning HTML. - Fixed `!weather` command returning `` instead of weather data: wttr.in now returns HTML when it detects a browser User-Agent, so replaced the fake Firefox UA string with `zynk/VERSION`. +- Fixed `!forecast` showing all days as Sunday on musl libc (Alpine Linux): `strptime` on musl does not compute `tm_wday`, so added `mktime()` to normalize the struct before formatting. - Version bumped to 0.34.1. 2026.07.19 – Uptime command, remove !hello. diff --git a/zynk.c b/zynk.c index a2fd801..37b5160 100644 --- a/zynk.c +++ b/zynk.c @@ -1504,7 +1504,7 @@ static char *fetch_forecast(const char *city_url, const char *city_display) { } } struct tm tm = {0}; - if (strptime(date, "%Y-%m-%d", &tm)) strftime(fmt_date[ndays], sizeof fmt_date[ndays], "%a %d %b", &tm); + if (strptime(date, "%Y-%m-%d", &tm)) { mktime(&tm); strftime(fmt_date[ndays], sizeof fmt_date[ndays], "%a %d %b", &tm); } else snprintf(fmt_date[ndays], sizeof fmt_date[ndays], "%s", date); snprintf(line[ndays], sizeof line[ndays], "%s: %s\u00b0C %s", fmt_date[ndays], temp, cond); ndays++;