dtappbuilder: Resolve format-overflow issues

This commit is contained in:
Peter Howkins
2021-12-23 19:57:22 +00:00
committed by Jon Trulson
parent 04fcc11f12
commit 33fad36133
7 changed files with 12 additions and 12 deletions

View File

@@ -1204,7 +1204,7 @@ exec_run(void)
{
ABObj project= NULL;
char executable_name[1024];
char cmd[1024];
char cmd[sizeof(executable_name) + 3];
STRING argv[5];
*executable_name = 0;
*cmd = 0;

View File

@@ -371,7 +371,7 @@ projP_save_export_bil(
}
else /* An error occurred with stat */
{
sprintf(Buf, "%s: %s", new_filename, strerror(errno));
snprintf(Buf, sizeof(Buf), "%s: %s", new_filename, strerror(errno));
util_printf_err(Buf);
}
XtUnmanageChild(AB_generic_chooser);

View File

@@ -1492,7 +1492,7 @@ proj_save_exploded(
else /* An error occurred with stat */
{
obj_set_name(project, old_name);
sprintf(Buf, "%s: %s", mod_exp_file, strerror(errno));
snprintf(Buf, sizeof(Buf), "%s: %s", mod_exp_file, strerror(errno));
util_printf_err(Buf);
if (old_name != NULL) util_free(old_name);
if (old_file != NULL) util_free(old_file);
@@ -1558,7 +1558,7 @@ proj_save_exploded(
if ((iRet = util_mkdir_hier(dir)) < 0)
{
obj_set_name(project, old_name);
sprintf(Buf, "%s: %s", dir, strerror(errno));
snprintf(Buf, sizeof(Buf), "%s: %s", dir, strerror(errno));
util_printf_err(Buf);
if (rel_path) util_free(rel_path);
if (old_name != NULL) util_free(old_name);
@@ -2135,7 +2135,7 @@ save_proj_as_bix(
}
else /* An error occurred with stat */
{
sprintf(Buf, "%s: %s", bix_file, strerror(errno));
snprintf(Buf, sizeof(Buf), "%s: %s", bix_file, strerror(errno));
xm_buf = XmStringCreateLocalized(Buf);
dtb_proj_error_msg_initialize(&dtb_proj_error_msg);
(void)dtb_show_modal_message(dtb_get_toplevel_widget(),