second and third args to scanc() (string and table) are not and should not
be modified. Make them 'const'.
This commit is contained in:
parent
a5b6b0d19f
commit
bba547e063
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: libkern.h,v 1.10 1996/09/22 16:23:31 cgd Exp $ */
|
||||
/* $NetBSD: libkern.h,v 1.11 1996/10/24 23:50:32 cgd Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -154,7 +154,7 @@ int bcmp __P((const void *, const void *, size_t));
|
||||
int ffs __P((int));
|
||||
u_long random __P((void));
|
||||
char *rindex __P((const char *, int));
|
||||
int scanc __P((u_int, u_char *, u_char *, int));
|
||||
int scanc __P((u_int, const u_char *, const u_char *, int));
|
||||
int skpc __P((int, size_t, u_char *));
|
||||
size_t strlen __P((const char *));
|
||||
char *strcat __P((char *, const char *));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: scanc.c,v 1.3 1996/03/14 18:52:16 christos Exp $ */
|
||||
/* $NetBSD: scanc.c,v 1.4 1996/10/24 23:50:31 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1989 Regents of the University of California.
|
||||
@ -41,10 +41,10 @@
|
||||
int
|
||||
scanc(size, cp, table, mask)
|
||||
u_int size;
|
||||
register u_char *cp, table[];
|
||||
const register u_char *cp, table[];
|
||||
register u_char mask;
|
||||
{
|
||||
register u_char *end = &cp[size];
|
||||
const register u_char *end = &cp[size];
|
||||
|
||||
while (cp < end && (table[*cp] & mask) == 0)
|
||||
cp++;
|
||||
|
Loading…
Reference in New Issue
Block a user