Module Name: src Committed By: rillig Date: Sun Apr 25 20:14:29 UTC 2021
Modified Files: src/games/cgram: cgram.c Log Message: cgram: conform to lint's strict bool mode, KNF To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/games/cgram/cgram.c diff -u src/games/cgram/cgram.c:1.18 src/games/cgram/cgram.c:1.19 --- src/games/cgram/cgram.c:1.18 Thu Apr 22 14:57:36 2021 +++ src/games/cgram/cgram.c Sun Apr 25 20:14:29 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: cgram.c,v 1.18 2021/04/22 14:57:36 wiz Exp $ */ +/* $NetBSD: cgram.c,v 1.19 2021/04/25 20:14:29 rillig Exp $ */ /*- * Copyright (c) 2013, 2021 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: cgram.c,v 1.18 2021/04/22 14:57:36 wiz Exp $"); +__RCSID("$NetBSD: cgram.c,v 1.19 2021/04/25 20:14:29 rillig Exp $"); #endif #include <assert.h> @@ -216,7 +216,9 @@ char_at_cursor(void) return lines.v[cursor_y].s[cursor_x]; } -static void getquote(FILE *f) { +static void +getquote(FILE *f) +{ struct string line; string_init(&line); @@ -255,7 +257,7 @@ readfile(const char *name) getquote(f); if (fclose(f) != 0) - exit(1); + err(1, "%s", name); } @@ -558,7 +560,7 @@ init(const char *filename) stringarray_init(&lines); stringarray_init(&sollines); srandom((unsigned int)time(NULL)); - if (filename) { + if (filename != NULL) { readfile(filename); } else { readquote();