// lower-case the social name before asking the MUD
static char lcSocName[LGST];
for (int i = 0; i < LGST && sname[i] != '\0'; i++) {
lcSocName[i] = tolower(sname[i]);
}
// lower-case the social name before asking the MUD
static char lcSocName[LGST];
for (int i = 0; i < LGST; i++) {
if( sname[i] != '\0' )
lcSocName[i] = tolower(sname[i]);
else
lcSocName[i] = '\0';
}
for( i = 0; i < LGST && sname[i] != '\0'; i++ )
lcSocName[i] = tolower( sname[i] );
lcSocName[i] = '\0';
for( i = 0; i < LGST && sname[i] != '\0'; i++ )
lcSocName[i] = tolower( sname[i] );
lcSocName[i] = '\0';
if( ( social = find_social( lcSocName, FALSE ) ) == NULL )
{
imc_printf( ch, "~YSocial ~W%s~Y does not exist on this mud.\r\n", sname );
return socname;
}
static char lcSocName[LGST];
lcSocName[0] = '\0';
for( int i = 0; i < LGST && sname[i] != '\0'; i++ )
{
lcSocName[i] = tolower( sname[i] );
}
lcSocName[i] = '\0'doesn't NULL the string. It only adds a NULL at the position i is currently at. This should eliminate the issue that Kayle was talking about.
lcSocName[i] = '\0'doesn't NULL the string. It only adds a NULL at the position i is currently at.
Thanks for all the help!