From: Alan T. DeKok Date: Mon, 4 Nov 2019 22:01:00 +0000 (-0500) Subject: move lowercase to caller X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9aafca9c820ebd6f7d6cb0453f89735eda010d19;p=thirdparty%2Ffreeradius-server.git move lowercase to caller --- diff --git a/src/lib/util/dict_util.c b/src/lib/util/dict_util.c index 4296bcfc5e5..4359496f9e9 100644 --- a/src/lib/util/dict_util.c +++ b/src/lib/util/dict_util.c @@ -2156,10 +2156,12 @@ fr_dict_enum_t *fr_dict_enum_by_alias(fr_dict_attr_t const *da, char const *alia static int dict_dlopen(fr_dict_t *dict, char const *name) { char *module_name; + char *p, *q; if (!name) return 0; module_name = talloc_typed_asprintf(NULL, "libfreeradius-%s", name); + for (p = module_name, q = p + talloc_array_length(p) - 1; p < q; p++) *p = tolower(*p); /* * Pass in dict as the uctx so that we can get at it in diff --git a/src/lib/util/dl.c b/src/lib/util/dl.c index bc9e4be2f0e..71676ecf789 100644 --- a/src/lib/util/dl.c +++ b/src/lib/util/dl.c @@ -232,8 +232,12 @@ int dl_symbol_init(dl_loader_t *dl_loader, dl_t const *dl) snprintf(buffer, sizeof(buffer), "%s_%s", dl->name, init->symbol); + /* + * '-' is not a valid symbol character in + * C. But "libfreeradius-radius" is a + * valid library name. So we hash things together. + */ for (p = buffer; *p != '\0'; p++) { - if (isupper((int) *p)) *p = tolower((int) *p); if (*p == '-') *p = '_'; }