1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

dtfile/SharedProcs: CID 88158,88337,89104,89118

This commit is contained in:
Jon Trulson 2018-04-11 12:46:57 -06:00
parent dd03c9cbf7
commit d30719f3a2

View file

@ -393,7 +393,7 @@ _DtLoadSubdialogArray (
{ {
int i; int i;
char number[10]; static char number[10];
/* Load sub-dialogs */ /* Load sub-dialogs */
nameList[nameCount] = number; nameList[nameCount] = number;
@ -404,7 +404,7 @@ _DtLoadSubdialogArray (
for (i = 0; i < dialogCount; i++) for (i = 0; i < dialogCount; i++)
{ {
sprintf(number, "%d", firstId); snprintf(number, 10, "%d", firstId);
(*dialogArray)[i] = _DtGetResourceDialogData(dialogId, dataBase, nameList); (*dialogArray)[i] = _DtGetResourceDialogData(dialogId, dataBase, nameList);
firstId++; firstId++;
} }
@ -423,14 +423,14 @@ _DtSaveSubdialogArray (
{ {
int i; int i;
char number[10]; static char number[10];
nameList[nameCount] = number; nameList[nameCount] = number;
nameList[nameCount + 1] = NULL; nameList[nameCount + 1] = NULL;
for (i = 0; i < dialogCount; i++) for (i = 0; i < dialogCount; i++)
{ {
sprintf(number, "%d", firstId); snprintf(number, 10, "%d", firstId);
_DtWriteDialogData(dialogArray[i], fd, nameList); _DtWriteDialogData(dialogArray[i], fd, nameList);
firstId++; firstId++;
} }
@ -1374,10 +1374,12 @@ RetrieveAndUseNameTemplateInfo(
sprintf(buffer_name, name_template, template_input); sprintf(buffer_name, name_template, template_input);
DtDtsFreeAttributeValue(name_template); DtDtsFreeAttributeValue(name_template);
XtFree(template_input); XtFree(template_input);
XtFree(name_template);
return(buffer_name); return(buffer_name);
} }
else else
{ {
XtFree(name_template);
return(template_input); return(template_input);
} }
} }
@ -1628,7 +1630,7 @@ _DtPathFromInput(
/* Resolve, if there're any, environment variables */ /* Resolve, if there're any, environment variables */
{ {
FILE *pfp; FILE *pfp = NULL;
char command[MAXPATHLEN]; char command[MAXPATHLEN];
memset(command, 0, sizeof(command)); memset(command, 0, sizeof(command));
@ -1650,7 +1652,7 @@ _DtPathFromInput(
sleep (1); sleep (1);
if (NULL != (fgets(command,MAXPATHLEN,pfp))) if (NULL != (fgets(command,MAXPATHLEN,pfp)))
break; break;
} }
if (i >= 5) if (i >= 5)
read_ok = 0; read_ok = 0;
} }
@ -1665,8 +1667,14 @@ _DtPathFromInput(
XtFree(path); XtFree(path);
path = XtNewString(command); path = XtNewString(command);
pclose(pfp); pclose(pfp);
pfp = NULL;
} }
} }
if (pfp)
{
pclose(pfp);
pfp = NULL;
}
} }
/* Resolve '~' -- new memory is allocated, old memory is freed */ /* Resolve '~' -- new memory is allocated, old memory is freed */