summaryrefslogtreecommitdiffstats
path: root/games/adventure
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1996-12-13 14:28:59 +0000
committerbde <bde@FreeBSD.org>1996-12-13 14:28:59 +0000
commitacdad6797aaead984c169505e04d8d70e831a206 (patch)
tree818fdec8d8d6c849641acf1728c89ba656c4eba6 /games/adventure
parenta50e6b549f6e1664cc001e74aed209aa1b47713f (diff)
downloadFreeBSD-src-acdad6797aaead984c169505e04d8d70e831a206.zip
FreeBSD-src-acdad6797aaead984c169505e04d8d70e831a206.tar.gz
Fixed extra columns in output for input lines with leading spaces.
Diffstat (limited to 'games/adventure')
-rw-r--r--games/adventure/setup.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/games/adventure/setup.c b/games/adventure/setup.c
index 06371f5..9f10df8 100644
--- a/games/adventure/setup.c
+++ b/games/adventure/setup.c
@@ -93,6 +93,8 @@ char *argv[];
{
if (linestart && c == ' ') /* Convert first spaces to tab */
{
+ if (count++ % LINE == 0)
+ printf("\n\t");
printf("0x%02x,", ('\t' ^ random()) & 0xFF);
while ((c = getc(infile)) == ' ' && c != EOF);
/* Drop the non-whitespace character through */
@@ -107,7 +109,7 @@ char *argv[];
linestart = YES; /* Ready to convert spaces again */
break;
}
- if (count++ % LINE == 0) /* Finished a line? */
+ if (count++ % LINE == 0)
printf("\n\t");
printf("0x%02x,", (c ^ random()) & 0xFF);
}
OpenPOWER on IntegriCloud