Deleted Added
full compact
strchr.c (229368) strchr.c (229571)
1/*-
2 * Copyright (c) 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#if defined(LIBC_SCCS) && !defined(lint)
31static char sccsid[] = "@(#)index.c 8.1 (Berkeley) 6/4/93";
32#endif /* LIBC_SCCS and not lint */
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#if defined(LIBC_SCCS) && !defined(lint)
31static char sccsid[] = "@(#)index.c 8.1 (Berkeley) 6/4/93";
32#endif /* LIBC_SCCS and not lint */
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/lib/libc/string/strchr.c 229368 2012-01-03 07:14:01Z ed $");
34__FBSDID("$FreeBSD: head/lib/libc/string/strchr.c 229571 2012-01-05 10:32:53Z ed $");
35
36#include <stddef.h>
37#include <string.h>
38
39char *
40strchr(const char *p, int ch)
41{
42 char c;
43
44 c = ch;
45 for (;; ++p) {
46 if (*p == c)
47 return ((char *)p);
48 if (*p == '\0')
49 return (NULL);
50 }
51 /* NOTREACHED */
52}
53
35
36#include <stddef.h>
37#include <string.h>
38
39char *
40strchr(const char *p, int ch)
41{
42 char c;
43
44 c = ch;
45 for (;; ++p) {
46 if (*p == c)
47 return ((char *)p);
48 if (*p == '\0')
49 return (NULL);
50 }
51 /* NOTREACHED */
52}
53
54__strong_reference(strchr, index);
54__weak_reference(strchr, index);