summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-06-30 19:10:49 +0000
committerbde <bde@FreeBSD.org>1998-06-30 19:10:49 +0000
commitcb8e733b14ce95ee791c5c30bdb635007d017c0b (patch)
tree2c07092c2d007b08c3c062b3f7ae9313d6492089
parentde8d2e85734bb002261ea6c0336fa6a4efa6e2f5 (diff)
downloadFreeBSD-src-cb8e733b14ce95ee791c5c30bdb635007d017c0b.zip
FreeBSD-src-cb8e733b14ce95ee791c5c30bdb635007d017c0b.tar.gz
Fixed printf format errors.
-rw-r--r--games/adventure/setup.c4
-rw-r--r--games/atc/main.c3
-rw-r--r--games/canfield/cfscores/cfscores.c18
-rw-r--r--games/larn/bill.c4
-rw-r--r--games/primes/primes.c4
-rw-r--r--games/robots/score.c3
-rw-r--r--games/rogue/score.c2
-rw-r--r--games/trek/move.c5
8 files changed, 22 insertions, 21 deletions
diff --git a/games/adventure/setup.c b/games/adventure/setup.c
index 9e7f977..da1c09f 100644
--- a/games/adventure/setup.c
+++ b/games/adventure/setup.c
@@ -96,7 +96,7 @@ char *argv[];
{
if (count++ % LINE == 0)
printf("\n\t");
- printf("0x%02x,", ('\t' ^ random()) & 0xFF);
+ printf("0x%02lx,", ('\t' ^ random()) & 0xFF);
while ((c = getc(infile)) == ' ' && c != EOF);
/* Drop the non-whitespace character through */
linestart = NO;
@@ -112,7 +112,7 @@ char *argv[];
}
if (count++ % LINE == 0)
printf("\n\t");
- printf("0x%02x,", (c ^ random()) & 0xFF);
+ printf("0x%02lx,", (c ^ random()) & 0xFF);
}
puts("\n\t0\n};");
fclose(infile);
diff --git a/games/atc/main.c b/games/atc/main.c
index a156536..115a916 100644
--- a/games/atc/main.c
+++ b/games/atc/main.c
@@ -109,8 +109,7 @@ main(ac, av)
av++;
break;
default:
- fprintf(stderr, "Unknown option '%c'\n", *ptr,
- name);
+ fprintf(stderr, "Unknown option '%c'\n", *ptr);
f_usage++;
break;
}
diff --git a/games/canfield/cfscores/cfscores.c b/games/canfield/cfscores/cfscores.c
index f476c11..fb7a090 100644
--- a/games/canfield/cfscores/cfscores.c
+++ b/games/canfield/cfscores/cfscores.c
@@ -136,14 +136,14 @@ printuser(pw, printfail)
printf("* Losses for %-10s*\n", pw->pw_name);
printf("*======================*\n");
printf("|Costs Total |\n");
- printf("| Hands %8d |\n", total.hand);
- printf("| Inspections %8d |\n", total.inspection);
- printf("| Games %8d |\n", total.game);
- printf("| Runs %8d |\n", total.runs);
- printf("| Information %8d |\n", total.information);
- printf("| Think time %8d |\n", total.thinktime);
- printf("|Total Costs %8d |\n", total.wins - total.worth);
- printf("|Winnings %8d |\n", total.wins);
- printf("|Net Worth %8d |\n", total.worth);
+ printf("| Hands %8ld |\n", total.hand);
+ printf("| Inspections %8ld |\n", total.inspection);
+ printf("| Games %8ld |\n", total.game);
+ printf("| Runs %8ld |\n", total.runs);
+ printf("| Information %8ld |\n", total.information);
+ printf("| Think time %8ld |\n", total.thinktime);
+ printf("|Total Costs %8ld |\n", total.wins - total.worth);
+ printf("|Winnings %8ld |\n", total.wins);
+ printf("|Net Worth %8ld |\n", total.worth);
printf("*----------------------*\n\n");
}
diff --git a/games/larn/bill.c b/games/larn/bill.c
index 4cf0cae..bbb63dc 100644
--- a/games/larn/bill.c
+++ b/games/larn/bill.c
@@ -130,11 +130,11 @@ mailbill()
exit(0);
while (*cp != NULL) {
if (*cp[0] == '1') {
- sprintf(buf, "\n%d gold pieces back with you from your journey. As the",
+ sprintf(buf, "\n%ld gold pieces back with you from your journey. As the",
(long)c[GOLD]);
write(fd, buf, strlen(buf));
} else if (*cp[0] == '2') {
- sprintf(buf, "\nin preparing your tax bill. You owe %d gold pieces as", (long)c[GOLD]*TAXRATE);
+ sprintf(buf, "\nin preparing your tax bill. You owe %ld gold pieces as", (long)c[GOLD]*TAXRATE);
write(fd, buf, strlen(buf));
} else
write(fd, *cp, strlen(*cp));
diff --git a/games/primes/primes.c b/games/primes/primes.c
index ceec7e0..e928885 100644
--- a/games/primes/primes.c
+++ b/games/primes/primes.c
@@ -256,7 +256,7 @@ primes(start, stop)
for (p = &prime[0], factor = prime[0];
factor < stop && p <= pr_limit; factor = *(++p)) {
if (factor >= start) {
- printf("%u\n", factor);
+ printf("%lu\n", factor);
}
}
/* return early if we are done */
@@ -319,7 +319,7 @@ primes(start, stop)
*/
for (q = table; q < tab_lim; ++q, start+=2) {
if (*q) {
- printf("%u\n", start);
+ printf("%lu\n", start);
}
}
}
diff --git a/games/robots/score.c b/games/robots/score.c
index 81cf7fd..62d97d4 100644
--- a/games/robots/score.c
+++ b/games/robots/score.c
@@ -180,5 +180,6 @@ show_score()
inf = 1;
for (scp = Top; scp < &Top[MAXSCORES]; scp++)
if (scp->s_score >= 0)
- printf("%d\t%d\t%.*s\n", inf++, scp->s_score, sizeof scp->s_name, scp->s_name);
+ printf("%d\t%d\t%.*s\n", inf++, scp->s_score,
+ (int)sizeof(scp->s_name), scp->s_name);
}
diff --git a/games/rogue/score.c b/games/rogue/score.c
index 385a401..06b10b7 100644
--- a/games/rogue/score.c
+++ b/games/rogue/score.c
@@ -336,7 +336,7 @@ object *monster;
}
}
}
- sprintf(buf, "%2d %6d %s: ", rank+1, rogue.gold, login_name);
+ sprintf(buf, "%2d %6ld %s: ", rank+1, rogue.gold, login_name);
if (other) {
switch(other) {
diff --git a/games/trek/move.c b/games/trek/move.c
index 5016544..e812e75 100644
--- a/games/trek/move.c
+++ b/games/trek/move.c
@@ -116,8 +116,9 @@ double speed;
evtime = Now.eventptr[E_LRTB]->date - Now.date;
# ifdef xTRACE
if (Trace)
- printf("E.ep = %u, ->evcode = %d, ->date = %.2f, evtime = %.2f\n",
- Now.eventptr[E_LRTB], Now.eventptr[E_LRTB]->evcode,
+ printf("E.ep = %p, ->evcode = %d, ->date = %.2f, evtime = %.2f\n",
+ (void *)Now.eventptr[E_LRTB],
+ Now.eventptr[E_LRTB]->evcode,
Now.eventptr[E_LRTB]->date, evtime);
# endif
if (time > evtime && Etc.nkling < 3)
OpenPOWER on IntegriCloud