Hmmm. I didn't realize these commands were constructed in-code in "apply_change".
So the problem here was that some the magic strings where input two times, and upper-lower case was inconsistent in the code.
I think instead of using strncasecmp (since it's not part of the standard, I think it's best to try to avoid), OOFEG should #define all the magic strings and check them exactly, i.e.;
#define SET_ZPROF_SCALE "set_zprof_scale"
#define ACTIVE_STEP "active_step"
but I don't see why one would need to use strings at all here.
Just an Enum variable seems more suitable for these commands.
I.e. change to
enum OOFEGCommand {
OC_ActiveStep,
....
}
static void apply_change(Widget wid, XtPointer cl, XtPointer cd)
{
OOFEGSimpleCmd((OOFEGCommand)cl, (char*)cd);
}
// readSimpleString redundant
Much safer and simpler code.
I don't see a need to ever run OOFEGSimpleCmd manually either, since if OOFEG knows about the command, then surely there would also be a button for it already.