The loop as written always incremented p after the test to deal with
leading digits, so it wouldn't notice a leading lower case letter.
* for the first char.
*/
p = fr_sbuff_current(&env_m[i]);
- if (isdigit((int)*p)) *p = '_';
- while (p++ < fr_sbuff_current(&sbuff)) {
+ if (isdigit((int)*p)) *p++ = '_';
+ for (; p < fr_sbuff_current(&sbuff); p++) {
if (isalpha((int)*p)) *p = toupper(*p);
else if (*p == '-') *p = '_';
else if (isdigit((int)*p)) continue;