From 6e134d3c6d359717d920840eb2fab240baee850d Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 30 Jan 1998 17:07:17 +0000 Subject: [PATCH] (lsearch): Return a pointer to the new element if one was "allocated". --- misc/lsearch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/lsearch.c b/misc/lsearch.c index 4bc0414088..68f89be8ca 100644 --- a/misc/lsearch.c +++ b/misc/lsearch.c @@ -1,5 +1,5 @@ /* Linear search functions. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -33,7 +33,7 @@ lsearch (const void *key, void *base, size_t *nmemb, size_t size, if (result == NULL) { /* Not available. Insert at the end. */ - memcpy (base + (*nmemb) * size, key, size); + result = memcpy (base + (*nmemb) * size, key, size); ++(*nmemb); }