From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5165 invoked from network); 21 Oct 2022 21:17:42 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 21 Oct 2022 21:17:42 -0000 Received: (qmail 13958 invoked by uid 550); 21 Oct 2022 21:17:39 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 13899 invoked from network); 21 Oct 2022 21:17:38 -0000 From: Ismael Luceno To: musl@lists.openwall.com Cc: Rich Felker , Ismael Luceno Date: Fri, 21 Oct 2022 23:17:20 +0200 Message-Id: <20221021211720.16465-1-ismael@iodev.co.uk> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam: Yes Subject: [musl] [RFC PATCH] implement strndupa Signed-off-by: Ismael Luceno --- include/string.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/string.h b/include/string.h index 43ad0942edd5..fda7b2e4f57c 100644 --- a/include/string.h +++ b/include/string.h @@ -89,6 +89,7 @@ void explicit_bzero (void *, size_t); #ifdef _GNU_SOURCE #define strdupa(x) strcpy(alloca(strlen(x)+1),x) +#define strndupa(x, n) strlcpy(alloca(strnlen((x), (n)), (x), (n)) int strverscmp (const char *, const char *); char *strchrnul(const char *, int); char *strcasestr(const char *, const char *); -- 2.38.1