diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/openvice.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/util/openvice.c b/util/openvice.c index bf258a3f..588fc41d 100644 --- a/util/openvice.c +++ b/util/openvice.c @@ -20,14 +20,14 @@ int main(int argc, char **argv) // XXX: resolve_utmp(); attach_SHM(); - srand(SHM->number); + srandom(SHM->number); /* FIXME 小站的 SHM->number 變化不大, 可能導致開獎號碼固定 */ if (!fp || !fb ) perror("error open file"); - bingo = rand() % MAX_BINGO; + bingo = random() % MAX_BINGO; fprintf(fp, "%1c[1;33m統一發票中獎號碼[m\n", ' '); fprintf(fp, "%1c[1;37m================[m\n", ' '); fprintf(fp, "%1c[1;31m特別獎[m: [1;31m%08d[m\n\n", ' ', bingo); @@ -35,7 +35,7 @@ int main(int argc, char **argv) while (i < 5) { - bingo = (base + rand()) % MAX_BINGO; + bingo = (base + random()) % MAX_BINGO; fprintf(fp, "%1c[1;36m第%s獎[m: [1;37m%08d[m\n", ' ', TABLE[i], bingo); fprintf(fb, "%08d\n", bingo); i++; |