From adecd3c68045d04dc367d30faf2eb5cac1f45d5a Mon Sep 17 00:00:00 2001 From: dg199075 Date: Wed, 22 Nov 2006 08:04:27 -0800 Subject: PSARC/2006/617 strnlen() 6478299 Add strnlen Contributed by Richard L. Hamilton --- usr/src/lib/abi/apptrace/common/interceptlib.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'usr/src/lib/abi') diff --git a/usr/src/lib/abi/apptrace/common/interceptlib.c b/usr/src/lib/abi/apptrace/common/interceptlib.c index a2ea131ce9..c17f0767a3 100644 --- a/usr/src/lib/abi/apptrace/common/interceptlib.c +++ b/usr/src/lib/abi/apptrace/common/interceptlib.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -48,20 +47,6 @@ static lwp_mutex_t abi_stdio_mutex = DEFAULTMUTEX; static volatile thread_t locktid = NOTID; static volatile int count; -size_t -strnlen(const char *s, size_t n) -{ - char *ptr; - - if (s == NULL) - return (n); - ptr = memchr(s, 0, n); - if (ptr == NULL) - return (n); - - return ((ptr - s) + 1); -} - /* Return true on empty */ int is_empty_string(char const *s) -- cgit v1.2.3