From c09870320103716ebfe84a3c2cfecdfafe3646cf Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 25 Mar 2006 22:48:32 +0000 Subject: [project @ 2006-03-25 22:48:32 by jmb] Assert that template names are <=11 chars long. Rename con_language to con_lang svn path=/import/netsurf/; revision=2165 --- riscos/configure.c | 2 +- riscos/dialog.c | 17 +++-------------- 2 files changed, 4 insertions(+), 15 deletions(-) (limited to 'riscos') diff --git a/riscos/configure.c b/riscos/configure.c index bba07b289..b933b8e49 100644 --- a/riscos/configure.c +++ b/riscos/configure.c @@ -80,7 +80,7 @@ void ro_gui_configure_initialise(void) { ro_gui_configure_register("con_home", ro_gui_options_home_initialise, ro_gui_wimp_event_finalise); - ro_gui_configure_register("con_language", + ro_gui_configure_register("con_lang", ro_gui_options_language_initialise, ro_gui_wimp_event_finalise); ro_gui_configure_register("con_inter", diff --git a/riscos/dialog.c b/riscos/dialog.c index f2e394f40..ee159229c 100644 --- a/riscos/dialog.c +++ b/riscos/dialog.c @@ -249,17 +249,12 @@ wimp_window * ro_gui_dialog_load_template(const char *template_name) wimp_window *window; os_error *error; + /* Template names must be <= 11 chars long */ + assert(strlen(template_name) <= 11); + /* wimp_load_template won't accept a const char * */ strncpy(name, template_name, sizeof name); - /* there is an OS bug such that wimp_load_template with a 12 character - * name will sometimes fail. to work around it we truncate such names to a - * 10 character wildcarded name, eg 'con_language' -> 'con_langua*' */ - if (strlen(template_name) > 11) { - name[10] = '*'; - name[11] = '\0'; - } - /* find required buffer sizes */ error = xwimp_load_template(wimp_GET_SIZE, 0, 0, wimp_NO_FONTS, name, 0, &window_size, &data_size, &context); @@ -283,12 +278,6 @@ wimp_window * ro_gui_dialog_load_template(const char *template_name) die("NoMemory"); } - /* the OS has updated our name, so we reset it back if required*/ - if (strlen(template_name) > 11) { - name[10] = '*'; - name[11] = '\0'; - } - /* load template */ error = xwimp_load_template(window, data, data + data_size, wimp_NO_FONTS, name, 0, 0, 0, 0); -- cgit v1.2.3