mirror of
https://github.com/open-simh/simh.git
synced 2026-04-15 00:08:47 +00:00
SCP: Silence compiler warning about potential sprintf buffer truncation
This commit is contained in:
4
scp.c
4
scp.c
@@ -2873,8 +2873,8 @@ if (cptr == NULL) {
|
||||
}
|
||||
else
|
||||
cptr2 = NULL;
|
||||
if (cptr && sizeof (nbuf) > strlen (cptr) + strlen ("/simh.ini") + 1) {
|
||||
sprintf(nbuf, "\"%s%s%ssimh.ini\"", cptr2 ? cptr2 : "", cptr, strchr (cptr, '/') ? "/" : "\\");
|
||||
if (cptr && (sizeof (nbuf) > strlen (cptr) + strlen ("/simh.ini") + 3)) {
|
||||
snprintf(nbuf, sizeof (nbuf), "\"%s%s%ssimh.ini\"", cptr2 ? cptr2 : "", cptr, strchr (cptr, '/') ? "/" : "\\");
|
||||
stat = do_cmd (-1, nbuf) & ~SCPE_NOMESSAGE; /* simh.ini proc cmd file */
|
||||
}
|
||||
if (SCPE_BARE_STATUS(stat) == SCPE_OPENERR)
|
||||
|
||||
Reference in New Issue
Block a user