Source-Changes-HG archive

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

[src/trunk]: src/lib/libcompat/regexp Forgot to commit this.



details:   https://anonhg.NetBSD.org/src/rev/a561b4c6a981
branches:  trunk
changeset: 472764:a561b4c6a981
user:      christos <christos%NetBSD.org@localhost>
date:      Thu May 06 17:09:31 1999 +0000

description:
Forgot to commit this.
delint: const castaway and cast to size_t

diffstat:

 lib/libcompat/regexp/regsub.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 6123df7f708c -r a561b4c6a981 lib/libcompat/regexp/regsub.c
--- a/lib/libcompat/regexp/regsub.c     Thu May 06 16:29:26 1999 +0000
+++ b/lib/libcompat/regexp/regsub.c     Thu May 06 17:09:31 1999 +0000
@@ -21,7 +21,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: regsub.c,v 1.7 1998/09/14 20:25:05 tv Exp $");
+__RCSID("$NetBSD: regsub.c,v 1.8 1999/05/06 17:09:31 christos Exp $");
 #endif /* not lint */
 
 #include <regexp.h>
@@ -59,6 +59,7 @@
                return;
        }
 
+       /* LINTED const castaway */
        src = (char *)source;
        dst = dest;
        while ((c = *src++) != '\0') {
@@ -74,7 +75,7 @@
                        *dst++ = c;
                } else if (prog->startp[no] != NULL && prog->endp[no] != NULL) {
                        len = prog->endp[no] - prog->startp[no];
-                       (void) strncpy(dst, prog->startp[no], len);
+                       (void) strncpy(dst, prog->startp[no], (size_t)len);
                        dst += len;
                        if (len != 0 && *(dst-1) == '\0') {     /* strncpy hit NUL. */
                                regerror("damaged match string");



Home | Main Index | Thread Index | Old Index