AmendHub

Download (as of this amendment):

jcs

/

amend

/

amendments

/

165

editor: Clear tm just in case, check mktime result


jcs made amendment 165 24 days ago
--- editor.c Sun Sep 27 11:27:54 2026 +++ editor.c Mon Sep 28 13:39:08 2026 @@ -452,13 +452,18 @@ editor_save(struct editor *editor) return; } + memset(&ttm, 0, sizeof(ttm)); ttm.tm_year = yy - 1900; ttm.tm_mon = mm - 1; ttm.tm_mday = dd; ttm.tm_hour = hh; ttm.tm_min = min; ttm.tm_sec = ss; - ts = mktime(&ttm); + ttm.tm_isdst = -1; + if ((ts = mktime(&ttm)) == -1) { + warn("Invalid timestamp"); + return; + } len = (*(editor->log_te))->teLength; if (len == 0) {