diff options
Diffstat (limited to 'src/lib/libc/string/strlen.c')
-rw-r--r-- | src/lib/libc/string/strlen.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/lib/libc/string/strlen.c b/src/lib/libc/string/strlen.c index d23aadafc0..ab006e04c2 100644 --- a/src/lib/libc/string/strlen.c +++ b/src/lib/libc/string/strlen.c | |||
@@ -1,6 +1,8 @@ | |||
1 | /* $OpenBSD: strlen.c,v 1.4 2001/07/29 21:15:23 millert Exp $ */ | ||
2 | |||
1 | /*- | 3 | /*- |
2 | * Copyright (c) 1990 The Regents of the University of California. | 4 | * Copyright (c) 1990, 1993 |
3 | * All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. |
4 | * | 6 | * |
5 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions |
@@ -32,19 +34,23 @@ | |||
32 | */ | 34 | */ |
33 | 35 | ||
34 | #if defined(LIBC_SCCS) && !defined(lint) | 36 | #if defined(LIBC_SCCS) && !defined(lint) |
35 | /*static char *sccsid = "from: @(#)strlen.c 5.5 (Berkeley) 1/26/91";*/ | 37 | static char *rcsid = "$OpenBSD: strlen.c,v 1.4 2001/07/29 21:15:23 millert Exp $"; |
36 | static char *rcsid = "$Id: strlen.c,v 1.1.1.1 1995/10/18 08:42:22 deraadt Exp $"; | ||
37 | #endif /* LIBC_SCCS and not lint */ | 38 | #endif /* LIBC_SCCS and not lint */ |
38 | 39 | ||
40 | #if !defined(_KERNEL) && !defined(_STANDALONE) | ||
39 | #include <string.h> | 41 | #include <string.h> |
42 | #else | ||
43 | #include <lib/libkern/libkern.h> | ||
44 | #endif | ||
40 | 45 | ||
41 | size_t | 46 | size_t |
42 | strlen(str) | 47 | strlen(str) |
43 | const char *str; | 48 | const char *str; |
44 | { | 49 | { |
45 | register const char *s; | 50 | const char *s; |
46 | 51 | ||
47 | for (s = str; *s; ++s); | 52 | for (s = str; *s; ++s) |
48 | return(s - str); | 53 | ; |
54 | return (s - str); | ||
49 | } | 55 | } |
50 | 56 | ||