Module Name:    src
Committed By:   rillig
Date:           Fri Oct  4 03:18:02 UTC 2024

Modified Files:
        src/lib/libc/time: zic.c
        src/lib/libcompat/4.3: ruserpass.c

Log Message:
libc, libcompat: fix lint warning about "effectively discards 'const'"

lib/libc/time/zic.c(2810): warning: call to 'strchr' effectively
discards 'const' from argument [346]

lib/libcompat/4.3/ruserpass.c(145): warning: call to 'strchr'
effectively discards 'const' from argument [346]

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/lib/libc/time/zic.c
cvs rdiff -u -r1.10 -r1.11 src/lib/libcompat/4.3/ruserpass.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/time/zic.c
diff -u src/lib/libc/time/zic.c:1.92 src/lib/libc/time/zic.c:1.93
--- src/lib/libc/time/zic.c:1.92	Wed Sep 11 13:50:34 2024
+++ src/lib/libc/time/zic.c	Fri Oct  4 03:18:01 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: zic.c,v 1.92 2024/09/11 13:50:34 christos Exp $	*/
+/*	$NetBSD: zic.c,v 1.93 2024/10/04 03:18:01 rillig Exp $	*/
 /*
 ** This file is in the public domain, so clarified as of
 ** 2006-07-17 by Arthur David Olson.
@@ -11,7 +11,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: zic.c,v 1.92 2024/09/11 13:50:34 christos Exp $");
+__RCSID("$NetBSD: zic.c,v 1.93 2024/10/04 03:18:01 rillig Exp $");
 #endif /* !defined lint */
 
 /* Use the system 'time' function, instead of any private replacement.
@@ -2803,9 +2803,9 @@ doabbr(char *abbr, size_t abbrlen, struc
     bool isdst, zic_t save, bool doquotes)
 {
 	char *	cp;
-	char *	slashp;
+	const char *slashp;
 	ptrdiff_t	len;
-	char const *format = zp->z_format;
+	const char *format = zp->z_format;
 
 	slashp = strchr(format, '/');
 	if (slashp == NULL) {

Index: src/lib/libcompat/4.3/ruserpass.c
diff -u src/lib/libcompat/4.3/ruserpass.c:1.10 src/lib/libcompat/4.3/ruserpass.c:1.11
--- src/lib/libcompat/4.3/ruserpass.c:1.10	Tue Oct 21 00:16:55 2003
+++ src/lib/libcompat/4.3/ruserpass.c	Fri Oct  4 03:18:02 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ruserpass.c,v 1.10 2003/10/21 00:16:55 fvdl Exp $	*/
+/*	$NetBSD: ruserpass.c,v 1.11 2024/10/04 03:18:02 rillig Exp $	*/
 
 /*
  * Copyright (c) 1985, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)ruserpass.c	8.4 (Berkeley) 4/27/95";
 #else
-__RCSID("$NetBSD: ruserpass.c,v 1.10 2003/10/21 00:16:55 fvdl Exp $");
+__RCSID("$NetBSD: ruserpass.c,v 1.11 2024/10/04 03:18:02 rillig Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -95,6 +95,7 @@ ruserpass(host, aname, apass)
 	char **aname, **apass;
 {
 	char *hdir, buf[BUFSIZ], *tmp;
+	const char *ctmp;
 	char myname[MAXHOSTNAMELEN + 1], *mydomain;
 	int t, i, c, usedefault = 0;
 	struct stat stb;
@@ -142,11 +143,11 @@ next:
 			 */
 			if (strcasecmp(host, tokval) == 0)
 				goto match;
-			if ((tmp = strchr(host, '.')) != NULL &&
-			    strcasecmp(tmp, mydomain) == 0 &&
+			if ((ctmp = strchr(host, '.')) != NULL &&
+			    strcasecmp(ctmp, mydomain) == 0 &&
 			    strncasecmp(host, tokval,
-			    (size_t)(tmp - host)) == 0 &&
-			    tokval[tmp - host] == '\0')
+			    (size_t)(ctmp - host)) == 0 &&
+			    tokval[ctmp - host] == '\0')
 				goto match;
 			continue;
 		}

Reply via email to