X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xoptions.c;h=2f58c7bd0fbb4c31a2ac79df00acd51a5fb1a468;hb=c28f9557f19deb9621b179d3c6ccbdf0458bd304;hp=b5368a3bd77abfed5c9a4e1a8799ce435e981ddf;hpb=91f35c4c0e1494e9711f26bb86f843e176c81321;p=xboard.git diff --git a/xoptions.c b/xoptions.c index b5368a3..2f58c7b 100644 --- a/xoptions.c +++ b/xoptions.c @@ -1432,7 +1432,7 @@ void SettingsCallback(w, client_data, call_data) XtSetArg(args[0], XtNstring, &val); XtGetValues(currentCps->option[i].handle, args, 1); if(strcmp(currentCps->option[i].textValue, val)) { - safeStrCpy(currentCps->option[i].textValue, val, sizeof(currentCps->option[i].textValue)/sizeof(currentCps->option[i].textValue[0])); + safeStrCpy(currentCps->option[i].textValue, val, MSG_SIZ - (currentCps->option[i].textValue - currentCps->option[i].name) ); snprintf(buf, MSG_SIZ, "option %s=%s\n", currentCps->option[i].name, val); SendToProgram(buf, currentCps); }