diff options
| author | rillig <rillig@NetBSD.org> | 2021-08-15 22:14:45 +0000 |
|---|---|---|
| committer | rillig <rillig@NetBSD.org> | 2021-08-15 22:14:45 +0000 |
| commit | 5635c3c91aea9690c4b1c33dc0d8813b5fdbab2f (patch) | |
| tree | e0403d4b0ce03530a0c4f52ddbfe93240d092d64 /lib/libedit | |
| parent | ec97f09ba669f1cb544212288bcbfcb80b8e40f1 (diff) | |
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.
Diffstat (limited to 'lib/libedit')
| -rw-r--r-- | lib/libedit/readline.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/libedit/readline.c b/lib/libedit/readline.c index 3b1b5e807aa..bf963b61807 100644 --- a/lib/libedit/readline.c +++ b/lib/libedit/readline.c @@ -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 * |
