char *pre, *suf, *title;
XmString emptyString;
+ size_t len;
#define TIGHTNESS 20
#define ICON_MIN_HEIGHT 83
pre = GETMESSAGE(3, 10, "Create Action");
suf = GETMESSAGE(7, 10, "Add Datatype");
- title = XtMalloc(strlen(pre) + strlen(suf) + 2);
- sprintf(title, "%s - %s", pre, suf);
+ len = strlen(pre) + strlen(suf) + 4;
+ title = XtMalloc(len);
+ snprintf(title,len - 1, "%s - %s", pre, suf);
_UxParent = XtVaCreatePopupShell( "AddFiletype_shell",
xmDialogShellWidgetClass, _UxParent,
int cnt;
Boolean bFound;
char *msgPtr1, *msgPtr2, *fmtPtr, *errPtr;
+ size_t len;
/**************************************************************************/
/* Determine the filetypes to delete and delete them. */
msgPtr2 = XtNewString(GETMESSAGE(5, 125,
"Please select the Datatype you would like to Delete."));
fmtPtr = "%s\n%s";
- errPtr = XtMalloc((strlen(msgPtr1) + strlen(msgPtr2) +
- strlen(fmtPtr) + 1) * sizeof(char));
- sprintf(errPtr, fmtPtr, msgPtr1, msgPtr2);
+ len = (strlen(msgPtr1) + strlen(msgPtr2) + strlen(fmtPtr) + 2);
+ errPtr = XtMalloc(len);
+ snprintf(errPtr,len - 1, fmtPtr, msgPtr1, msgPtr2);
XtFree(msgPtr2);
XtFree(msgPtr1);
display_error_message(CreateActionAppShell, errPtr);
char *ptr;
char tmpbuf[50];
char *pre, *suf, *title;
+ size_t len;
if (!CreateActionAppShellCheckFields()) {
pre = GETMESSAGE(3, 10, "Create Action");
suf = GETMESSAGE(7, 10, "Add Datatype");
- title = XtMalloc(strlen(pre) + strlen(suf) + 2);
- sprintf(title, "%s - %s", pre, suf);
+ len = strlen(pre) + strlen(suf) + 4;
+ title = XtMalloc(len);
+ snprintf(title,len - 1,"%s - %s", pre, suf);
XtVaSetValues (AddFiletype,
RES_CONVERT (XmNdialogTitle, title ),
int selecteditem;
char *msgPtr1, *msgPtr2, *fmtPtr, *errPtr;
char *pre, *suf, *title;
+ size_t len;
pre = GETMESSAGE(3, 10, "Create Action");
suf = GETMESSAGE(7, 11, "Edit Datatype");
- title = XtMalloc(strlen(pre) + strlen(suf) + 2);
- sprintf(title, "%s - %s", pre, suf);
+ len = strlen(pre) + strlen(suf) + 4;
+ title = XtMalloc(len);
+ snprintf(title,len - 1, "%s - %s", pre, suf);
/**************************************************************************/
/* Determine the selected list item. */
msgPtr2 = XtNewString(GETMESSAGE(5, 130,
"Please select the Datatype you would like to Edit."));
fmtPtr = "%s\n%s";
- errPtr = XtMalloc((strlen(msgPtr1) + strlen(msgPtr2) +
- strlen(fmtPtr) + 1) * sizeof(char));
- sprintf(errPtr, fmtPtr, msgPtr1, msgPtr2);
+ len = (strlen(msgPtr1) + strlen(msgPtr2) +
+ strlen(fmtPtr) + 3);
+ errPtr = XtMalloc(len);
+ snprintf(errPtr,len - 1, fmtPtr, msgPtr1, msgPtr2);
XtFree(msgPtr2);
XtFree(msgPtr1);
display_error_message(CreateActionAppShell, errPtr);