int
pg_char_to_encoding(const char *name)
{
char buff[NAMEDATALEN], // ------------------ UNINITIALIZED
key = clean_encoding_name(name, buff);
}
static char *
clean_encoding_name(const char *key, char *newkey)
{
const char *p;
char *np;
for (p = key, np = newkey; *p != '\0'; p++)
{
if (isalnum((unsigned char) *p))
{
if (*p >= 'A' && *p <= 'Z')
*np++ = *p + 'a' - 'A';
else
*np++ = *p;
}
}
*np = '\0';
return newkey;
}