diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2006-04-20 03:25:37 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2006-04-20 03:25:37 +0000 |
commit | 0ff887afde567ec0d599735c123f9661faee7e3a (patch) | |
tree | 5957a843724bedce94a0657bd4a7f58184d986e2 /games/tetris/scores.c | |
parent | 5d75087b8fdf1c7fbec78cc3b93a71d67561141f (diff) |
Replace magic numbers with sizeof(array).
OK jaredy@
Diffstat (limited to 'games/tetris/scores.c')
-rw-r--r-- | games/tetris/scores.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/games/tetris/scores.c b/games/tetris/scores.c index 3442e2cda53..5f52b02b706 100644 --- a/games/tetris/scores.c +++ b/games/tetris/scores.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scores.c,v 1.10 2004/07/10 07:26:24 deraadt Exp $ */ +/* $OpenBSD: scores.c,v 1.11 2006/04/20 03:25:36 ray Exp $ */ /* $NetBSD: scores.c,v 1.2 1995/04/22 07:42:38 cgd Exp $ */ /*- @@ -412,14 +412,14 @@ printem(int level, int offset, struct highscore *hs, int n, const char *me) for (row = 0; row < n; row++) { sp = &hs[row]; - (void)snprintf(buf, 100, + (void)snprintf(buf, sizeof(buf), "%3d%c %6d %-31s (%6d on %d)\n", row + offset, sp->hs_time ? '*' : ' ', sp->hs_score * sp->hs_level, sp->hs_name, sp->hs_score, sp->hs_level); /* Print leaders every three lines */ if ((row + 1) % 3 == 0) { - for (i = 0; i < 100; i++) + for (i = 0; i < sizeof(buf); i++) if (buf[i] == ' ') buf[i] = '_'; } |