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