Module Name: src Committed By: rillig Date: Sun Aug 15 22:14:45 UTC 2021
Modified Files: src/lib/libedit: readline.c Log Message: readline: fix lint warning about effective unconst cast Calling strchr to avoid the syntactical unconst cast is not necessary here. A simple pointer assignment is enough. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.160 -r1.161 src/lib/libedit/readline.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/libedit/readline.c diff -u src/lib/libedit/readline.c:1.160 src/lib/libedit/readline.c:1.161 --- src/lib/libedit/readline.c:1.160 Sun Aug 15 10:06:32 2021 +++ src/lib/libedit/readline.c Sun Aug 15 22:14:45 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: readline.c,v 1.160 2021/08/15 10:06:32 christos Exp $ */ +/* $NetBSD: readline.c,v 1.161 2021/08/15 22:14:45 rillig Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: readline.c,v 1.160 2021/08/15 10:06:32 christos Exp $"); +__RCSID("$NetBSD: readline.c,v 1.161 2021/08/15 22:14:45 rillig Exp $"); #endif /* not lint && not SCCSID */ #include <sys/types.h> @@ -208,11 +208,10 @@ static void _resize_fun(EditLine *el, void *a) { const LineInfo *li; - char **ap = a; + const char **ap = a; li = el_line(el); - /* a cheesy way to get rid of const cast. */ - *ap = memchr(li->buffer, *li->buffer, (size_t)1); + *ap = li->buffer; } static const char *