]> granicus.if.org Git - icu/commitdiff
ICU-20767 Potential negative index access in one of the sample codes
authorKeita Suzuki <keitasuzuki.park@sslab.ics.keio.ac.jp>
Fri, 9 Aug 2019 07:51:49 +0000 (16:51 +0900)
committerSteven R. Loomis <srl295@gmail.com>
Wed, 22 Jan 2020 21:13:27 +0000 (13:13 -0800)
icu4c/source/samples/ufortune/ufortune.c

index c1c203a983defd512ff7545a67cdcb3e9eea72a4..7bf5bab2c0130061bd4d46262a3f5e461b66591e 100644 (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));