summaryrefslogtreecommitdiff
path: root/app/xgc/text.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/xgc/text.c')
-rw-r--r--app/xgc/text.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/xgc/text.c b/app/xgc/text.c
index 6701fdb99..b27d09a2b 100644
--- a/app/xgc/text.c
+++ b/app/xgc/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",