ICU-20767 Potential negative index access in one of the sample codes

This commit is contained in:
Keita Suzuki 2019-08-09 16:51:49 +09:00 committed by Steven R. Loomis
parent ee2d1e7b9b
commit a4a5c603ac

View file

@ -193,7 +193,7 @@ int main(int argc, char **argv)
exit(-1);
}
i = (int)time(NULL) % numFortunes; /* Use time to pick a somewhat-random fortune. */
i = time(NULL) % numFortunes; /* Use time to pick a somewhat-random fortune. */
resString = ures_getStringByIndex(fortunes_r, i, &len, &err);
if (U_FAILURE(err)) {
fprintf(stderr, "%s: ures_getStringByIndex(%d) failed, %s\n", programName, i, u_errorName(err));