I have a little piece of code that creates random strings from the following:
with the following:
For some reason, some strings end in untranslatable characters, like upside-down question marks and odd squares.
It shouldn't be left-over junk in the buf char, because I've kind of cleared it with the initial
I'm starting to think it's calling some special ascii characters, but since all it's using is !@#$%*(),.;, I don't see why that's happening.
So.. any idea why this is happening?
Thanks :)
char letters[] = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%*(),.;";with the following:
buf[0] = '\0';
max = 3 + (2 * (int)(mob->level / 10));
for (a=0; a<max; a++)
{
temp=number_range(1,strlen(letters)-1);
buf[a]=letters[temp];
}
buf[a+1]='\0';
For some reason, some strings end in untranslatable characters, like upside-down question marks and odd squares.
It shouldn't be left-over junk in the buf char, because I've kind of cleared it with the initial
buf[0] = '\0';I'm starting to think it's calling some special ascii characters, but since all it's using is !@#$%*(),.;, I don't see why that's happening.
So.. any idea why this is happening?
Thanks :)