diff --git a/sc2/ChangeLog b/sc2/ChangeLog index c4d731449..f7d5fc1bc 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,6 @@ Changes towards version 0.7: +- Fixed a text entry width problem that was deleting control template + names (Bug #947) - Michael - uio cleanups, documentation - SvdB - uio path parsing fixes/improvements - SvdB - Windows UNC path support (#907) diff --git a/sc2/src/sc2code/setupmenu.c b/sc2/src/sc2code/setupmenu.c index 923c954b8..e68f51325 100644 --- a/sc2/src/sc2code/setupmenu.c +++ b/sc2/src/sc2code/setupmenu.c @@ -334,10 +334,13 @@ change_template (WIDGET_CHOICE *self, int oldval) static void rename_template (WIDGET_TEXTENTRY *self) { - strncpy (input_templates[choices[20].selected].name, self->value, WIDGET_TEXTENTRY_WIDTH); - /* TODO: This will have to change if the size of the input_templates name is changed */ - input_templates[choices[20].selected].name[WIDGET_TEXTENTRY_WIDTH-1] = 0; - + /* TODO: This will have to change if the size of the + input_templates name is changed. It would probably be nice + to track this symbolically or ensure that self->value's + buffer is always at least this big; this will require some + reworking of widgets */ + strncpy (input_templates[choices[20].selected].name, self->value, 30); + input_templates[choices[20].selected].name[29] = 0; } #define NUM_STEPS 20