summaryrefslogtreecommitdiff
path: root/text.c
diff options
context:
space:
mode:
Diffstat (limited to 'text.c')
-rw-r--r--text.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/text.c b/text.c
index 6701fdb..b27d09a 100644
--- a/text.c
+++ b/text.c
@@ -147,6 +147,10 @@ WriteText(Widget w, XEvent *event, String *params, Cardinal *num_params)
int type; /* which string # to send */
type = atoi(params[0]);
+ if (type < 0 || type >= NUMTEXTWIDGETS) {
+ fprintf(stderr, "Invalid value %s in WriteText()\n", params[0]);
+ return;
+ }
if (strcmp(textstrings[type],oldtextstrings[type])) {
strcpy(oldtextstrings[type],textstrings[type]);
snprintf(mbuf,sizeof mbuf,"%s%s\n",