array subscript is above array bounds

This commit is contained in:
Dennis Luxen 2011-07-06 16:50:53 +00:00
parent a79231c666
commit 108e1ad5e6

View File

@ -372,10 +372,10 @@ string GetRandomString() {
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
for (int i = 0; i < 128; ++i) {
for (int i = 0; i < 127; ++i) {
s[i] = alphanum[rand() % (sizeof(alphanum) - 1)];
}
s[128] = 0;
s[127] = 0;
return string(s);
}