mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-13 03:32:24 +00:00
dtfile: Resolve warnings about format string overflow.s
This commit is contained in:
parent
0307f6af82
commit
021a5ef691
2 changed files with 8 additions and 8 deletions
|
@ -2575,7 +2575,7 @@ SaveSession(
|
|||
{
|
||||
static char * name_list[] = { DTFILE_CLASS_NAME, NULL, NULL, NULL,
|
||||
NULL, NULL};
|
||||
char view_number[11];
|
||||
char view_number[12];
|
||||
char number[5];
|
||||
char workspaceNumber[11];
|
||||
int fd;
|
||||
|
@ -2639,13 +2639,13 @@ SaveSession(
|
|||
if (trashFileMgrData)
|
||||
{
|
||||
if (trashFileMgrData->file_mgr_rec)
|
||||
(void) sprintf (view_number, "%d", view_count + 1);
|
||||
(void) snprintf (view_number, sizeof(view_number), "%d", view_count + 1);
|
||||
else
|
||||
(void) sprintf (view_number, "%d", view_count);
|
||||
(void) snprintf (view_number, sizeof(view_number), "%d", view_count);
|
||||
}
|
||||
else
|
||||
{
|
||||
(void) sprintf (view_number, "%d", view_count);
|
||||
(void) snprintf (view_number, sizeof(view_number), "%d", view_count);
|
||||
}
|
||||
(void) write (fd, view_number, strlen (view_number));
|
||||
(void) write (fd, "\n#\n", strlen ("\n#\n"));
|
||||
|
@ -2817,7 +2817,7 @@ SaveSession(
|
|||
/* Save each of the secondary help dialogs */
|
||||
for (j = 0; j < workspaceInfo->secondaryHelpDialogCount; j++)
|
||||
{
|
||||
sprintf(number, "%d", j + 1);
|
||||
snprintf(number, sizeof(number), "%d", j + 1);
|
||||
_DtWriteDialogData(workspaceInfo->secondaryHelpDialogList[j],
|
||||
fd, name_list);
|
||||
}
|
||||
|
@ -2825,7 +2825,7 @@ SaveSession(
|
|||
/* Save the primary help dialog window */
|
||||
if (workspaceInfo->primaryHelpDialog)
|
||||
{
|
||||
sprintf(number, "%d", 0);
|
||||
snprintf(number, sizeof(number), "%d", 0);
|
||||
_DtWriteDialogData(workspaceInfo->primaryHelpDialog,
|
||||
fd, name_list);
|
||||
}
|
||||
|
|
|
@ -209,7 +209,7 @@ configFileOK(void)
|
|||
{
|
||||
msg1 = GETMESSAGE(21, 22, "Cannot open file manager configuration file: ");
|
||||
msg2 = strerror(errno);
|
||||
sprintf(g_errorMessage,"%s%s\n %s\n",msg1,fname,msg2);
|
||||
snprintf(g_errorMessage, sizeof(g_errorMessage), "%s%s\n %s\n",msg1,fname,msg2);
|
||||
_DtSimpleError (application_name, DtError, NULL, g_errorMessage, NULL);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -339,7 +339,7 @@ readConfigFile(const String fsType,
|
|||
{
|
||||
msg1 = GETMESSAGE(21, 22, "Cannot open file manager configuration file: ");
|
||||
msg2 = strerror(errno);
|
||||
sprintf(g_errorMessage,"%s%s\n %s\n",msg1,fname,msg2);
|
||||
snprintf(g_errorMessage, sizeof(g_errorMessage), "%s%s\n %s\n",msg1,fname,msg2);
|
||||
_DtSimpleError (application_name, DtError, NULL, g_errorMessage, NULL);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue