Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint2 lint: fix error message in lint2 for mis...



details:   https://anonhg.NetBSD.org/src/rev/22d28d4f6b46
branches:  trunk
changeset: 982619:22d28d4f6b46
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Apr 18 20:40:51 2021 +0000

description:
lint: fix error message in lint2 for missing record type in .ln file

diffstat:

 usr.bin/xlint/lint2/read.c |  12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diffs (33 lines):

diff -r 5cc61852e793 -r 22d28d4f6b46 usr.bin/xlint/lint2/read.c
--- a/usr.bin/xlint/lint2/read.c        Sun Apr 18 20:32:49 2021 +0000
+++ b/usr.bin/xlint/lint2/read.c        Sun Apr 18 20:40:51 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: read.c,v 1.42 2021/04/02 12:16:50 rillig Exp $ */
+/* $NetBSD: read.c,v 1.43 2021/04/18 20:40:51 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: read.c,v 1.42 2021/04/02 12:16:50 rillig Exp $");
+__RCSID("$NetBSD: read.c,v 1.43 2021/04/18 20:40:51 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -153,11 +153,9 @@
                }
 
                /* record type */
-               if (*cp != '\0') {
-                       rt = *cp++;
-               } else {
-                       inperr("null cp");
-               }
+               if (*cp == '\0')
+                       inperr("missing record type");
+               rt = *cp++;
 
                if (rt == 'S') {
                        setsrc(cp);



Home | Main Index | Thread Index | Old Index