summaryrefslogtreecommitdiffstats
path: root/games/number/number.c
diff options
context:
space:
mode:
authorbillf <billf@FreeBSD.org>1999-12-12 03:22:37 +0000
committerbillf <billf@FreeBSD.org>1999-12-12 03:22:37 +0000
commit82439631b566bbf3f5bfca1d46732aaf1c38a98e (patch)
tree3a5911cd4ce305174f5c2a6ed0f87154023b0921 /games/number/number.c
parentb66fb2c64801a0ee59e638561bfd8d3fe36b647c (diff)
downloadFreeBSD-src-82439631b566bbf3f5bfca1d46732aaf1c38a98e.zip
FreeBSD-src-82439631b566bbf3f5bfca1d46732aaf1c38a98e.tar.gz
-Wall fixes.
Diffstat (limited to 'games/number/number.c')
-rw-r--r--games/number/number.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/games/number/number.c b/games/number/number.c
index e6ef291..c7dfbe4 100644
--- a/games/number/number.c
+++ b/games/number/number.c
@@ -56,7 +56,7 @@ static const char rcsid[] =
#define MAXNUM 65 /* Biggest number we handle. */
-static char *name1[] = {
+static const char *name1[] = {
"", "one", "two", "three",
"four", "five", "six", "seven",
"eight", "nine", "ten", "eleven",
@@ -133,6 +133,7 @@ convert(line)
int flen, len, rval;
char *p, *fraction;
+ flen = NULL;
fraction = NULL;
for (p = line; *p != '\0' && *p != '\n'; ++p) {
if (isblank(*p)) {
@@ -163,7 +164,7 @@ badnum: errx(1, "illegal number: %s", line);
*p = '\0';
if ((len = strlen(line)) > MAXNUM ||
- fraction != NULL && (flen = strlen(fraction)) > MAXNUM)
+ (fraction != NULL && ((flen = strlen(fraction)) > MAXNUM)))
errx(1, "number too large, max %d digits.", MAXNUM);
if (*line == '-') {
OpenPOWER on IntegriCloud