From patchwork Mon Feb 3 14:36:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 235848 List-Id: U-Boot discussion From: sjg at chromium.org (Simon Glass) Date: Mon, 3 Feb 2020 07:36:00 -0700 Subject: [PATCH v2 14/32] string: Allow arch override of strndup() also In-Reply-To: <20200203143618.74619-1-sjg@chromium.org> References: <20200203143618.74619-1-sjg@chromium.org> Message-ID: <20200203073614.v2.14.Ic29632a2599ba5f6d287e5ac8491d9745979d3e9@changeid> At present architectures can override strdup() but not strndup(). Use the same option for both. Signed-off-by: Simon Glass --- Changes in v2: None include/linux/string.h | 2 +- lib/string.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/string.h b/include/linux/string.h index 5d63be4ce5..bb1d5ab07e 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -93,8 +93,8 @@ size_t strcspn(const char *s, const char *reject); #ifndef __HAVE_ARCH_STRDUP extern char * strdup(const char *); -#endif extern char * strndup(const char *, size_t); +#endif #ifndef __HAVE_ARCH_STRSWAB extern char * strswab(const char *); #endif diff --git a/lib/string.c b/lib/string.c index 9b779ddc3b..ae7835f600 100644 --- a/lib/string.c +++ b/lib/string.c @@ -324,7 +324,6 @@ char * strdup(const char *s) strcpy (new, s); return new; } -#endif char * strndup(const char *s, size_t n) { @@ -348,6 +347,7 @@ char * strndup(const char *s, size_t n) return new; } +#endif #ifndef __HAVE_ARCH_STRSPN /**