projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add include files to get prototype declarations, and fix bugs found.
[unix-history]
/
usr
/
src
/
lib
/
libc
/
string
/
index.c
diff --git
a/usr/src/lib/libc/string/index.c
b/usr/src/lib/libc/string/index.c
index
aa55b60
..
e734007
100644
(file)
--- a/
usr/src/lib/libc/string/index.c
+++ b/
usr/src/lib/libc/string/index.c
@@
-6,9
+6,10
@@
*/
#if defined(LIBC_SCCS) && !defined(lint)
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)index.c 5.
6
(Berkeley) %G%";
+static char sccsid[] = "@(#)index.c 5.
7
(Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */
#endif /* LIBC_SCCS and not lint */
+#include <sys/cdefs.h>
#include <string.h>
#include <stddef.h>
#include <string.h>
#include <stddef.h>
@@
-18,11
+19,11
@@
strchr(p, ch)
#else
index(p, ch)
#endif
#else
index(p, ch)
#endif
- register char *p, ch;
+ register c
onst c
har *p, ch;
{
for (;; ++p) {
if (*p == ch)
{
for (;; ++p) {
if (*p == ch)
- return(p);
+ return(
(char *)
p);
if (!*p)
return((char *)NULL);
}
if (!*p)
return((char *)NULL);
}