On Thu, Aug 15, 2013 at 3:24 PM, Gustavo Sverzut Barbieri <[email protected]> wrote: > On Thu, Aug 15, 2013 at 2:49 PM, José Roberto de Souza - Enlightenment > Git <[email protected]> wrote: > >> + char buf[1024], *value, *type; >> >> - for (i = 0; i < EINA_C_ARRAY_LENGTH(locale_cat_desc); i++) >> - { >> - if ((!setlocs[i]) && (locale_cat_desc[i].cat != LC_ALL)) >> - setlocale(locale_cat_desc[i].cat, "C"); >> + snprintf(buf, sizeof(buf), "%s", val); >> + >> + type = buf; >> + >> + value = strchr(buf, '='); >> + *value = 0; >> + value++; >> + >> + setenv(type, value, 1); > > super! but a hint: you don't have to snprintf() the buffer, it could > be a simple eina_strlcpy()...
or.... find the '=' first and memcpy only the first part, checking bounds with min(). Lucas De Marchi ------------------------------------------------------------------------------ Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
