Description: fix FTBFS with GCC 14 Bug-Debian: https://bugs.debian.org/1074911 Author: mirabilos Forwarded: not-needed (new upstream says their code builds fine) --- a/dpi/downloads.cc +++ b/dpi/downloads.cc @@ -520,7 +520,9 @@ void DLItem::log_text_add(const char *bu if (isdigit(*q++ = *p)) { // keep here } else if (*p == 'K') { - for (--q; isdigit(q[-1]); --q) ; log_state = ST_discard; + for (--q; isdigit(q[-1]); --q) + ; + log_state = ST_discard; } else { log_state = ST_copy; } @@ -662,6 +664,8 @@ void DLItem::child_finished(int status) MSG("wget status %d\n", status); } +#define secs2timestr_len 64 + /* * Convert seconds into human readable [hour]:[min]:[sec] string. */ @@ -672,11 +676,11 @@ static void secs2timestr(int et, char *s eh = et / 3600; em = (et % 3600) / 60; es = et % 60; if (eh == 0) { if (em == 0) - snprintf(str, 8, "%ds", es); + snprintf(str, secs2timestr_len, "%ds", es); else - snprintf(str, 8, "%dm%ds", em, es); + snprintf(str, secs2timestr_len, "%dm%ds", em, es); } else { - snprintf(str, 8, "%dh%dm", eh, em); + snprintf(str, secs2timestr_len, "%dh%dm", eh, em); } } @@ -688,7 +692,7 @@ void DLItem::update() struct stat ss; time_t curr_time; float csec, tsec, rate, _rate = 0; - char str[64]; + char str[secs2timestr_len]; int et; if (updates_done()) --- a/src/uicmd.cc +++ b/src/uicmd.cc @@ -1193,7 +1193,7 @@ void a_UIcmd_view_page_source(BrowserWin int buf_size; Dstr *dstr_url; DilloUrl *vs_url; - static int post_id = 0; + static unsigned short post_id = 0; char tag[8]; const char *content_type = a_Nav_get_content_type(url); @@ -1207,7 +1207,7 @@ void a_UIcmd_view_page_source(BrowserWin if (URL_FLAGS(url) & URL_Post) { /* append a custom string to differentiate POST URLs */ post_id = (post_id < 9999) ? post_id + 1 : 0; - snprintf(tag, 8, "_%.4d", post_id); + snprintf(tag, 8, "_%.4u", post_id); dStr_append(dstr_url, tag); } vs_url = a_Url_new(dstr_url->str, NULL);