summaryrefslogtreecommitdiffstats
path: root/games/primes
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1999-01-06 19:46:56 +0000
committerimp <imp@FreeBSD.org>1999-01-06 19:46:56 +0000
commit3936fe2a01920fe1fb3d7bf34ade29da706ff55e (patch)
tree9e52f1eef381c301d448ae2228de398bfba81ead /games/primes
parentf261ff0eff417c843bfdc277cfb7162762478375 (diff)
downloadFreeBSD-src-3936fe2a01920fe1fb3d7bf34ade29da706ff55e.zip
FreeBSD-src-3936fe2a01920fe1fb3d7bf34ade29da706ff55e.tar.gz
Fix printf errors in the hflag case.
Fix old bug with bogus casing to (long). Document the true limits of factor on 64-bit architectures. Submitted by: bde
Diffstat (limited to 'games/primes')
-rw-r--r--games/primes/primes.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/games/primes/primes.c b/games/primes/primes.c
index f204b37..7211de5 100644
--- a/games/primes/primes.c
+++ b/games/primes/primes.c
@@ -261,7 +261,7 @@ primes(start, stop)
for (p = &prime[0], factor = prime[0];
factor < stop && p <= pr_limit; factor = *(++p)) {
if (factor >= start) {
- printf(hflag ? "0x%x\n" : "%lu\n", factor);
+ printf(hflag ? "0x%lx\n" : "%lu\n", factor);
}
}
/* return early if we are done */
@@ -324,7 +324,7 @@ primes(start, stop)
*/
for (q = table; q < tab_lim; ++q, start+=2) {
if (*q) {
- printf(hflag ? "0x%x\n" : "%lu\n", start);
+ printf(hflag ? "0x%lx\n" : "%lu\n", start);
}
}
}
OpenPOWER on IntegriCloud