Skip to content
Snippets Groups Projects
Commit 7aa6f21e authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Resolve GCC 12.2 warnings

warning: format ‘%s’ expects argument of type ‘char *’, but argument 4 has type ‘void *’
warning: ‘sprintf’ writing a terminating nul past the end of the destination
parent 64d9ae61
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -2230,7 +2230,7 @@ capture_control(struct bbslist *bbs)
if ((tm = localtime(&t)) != NULL) { // The null-terminator
// overwrites the first
// byte of filesize
sprintf(sauce.date, "%04u%02u%02u",
snprintf(sauce.date, sizeof(sauce.date), "%04u%02u%02u",
1900 + tm->tm_year, 1 + tm->tm_mon, tm->tm_mday);
}
sauce.filesize = LE_INT32(ftell(fp)); // LE
......@@ -2949,7 +2949,7 @@ draw_ppm_str_handler(char *str, size_t slen, char *fn, void *apcd)
}
if (mask != NULL) {
if (asprintf(&maskfn, "%s%s", fn, mask) < 0)
if (asprintf(&maskfn, "%s%s", fn, (char*)mask) < 0)
goto done;
}
......@@ -3231,7 +3231,7 @@ paste_pixmap(char *str, size_t slen, char *fn, void *apcd)
}
if (mask != NULL) {
if (asprintf(&maskfn, "%s%s", fn, mask) < 0)
if (asprintf(&maskfn, "%s%s", fn, (char*)mask) < 0)
goto done;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment