blob: 07c7690fb8e3b798a56dabe2a293fc895337a217 [file] [log] [blame]
Andrew Geissler87f5cff2022-09-30 13:13:31 -05001From fae771aefc593a0ef798bc0c1e21b0524eb85e2d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 31 Aug 2022 20:32:35 -0700
4Subject: [PATCH] Tty.xs: Do not mark strlcpy as static
5
6Some libcs e.g. musl do not provide implementation of strlcpy but they
7do provide the signature in string.h, if we mark it static here then it
8conflicts with the libc define and compiler may warn/error
9
10Fixes
11Tty.xs:190:1: error: static declaration of 'strlcpy' follows non-static declaration
12strlcpy( ^
13/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/libio-pty-perl/1.16-r0/recipe-sysroot/usr/include/string.h:86:8: note: previous declaration is here
14size_t strlcpy (char *, const char *, size_t); ^
15
16Upstream-Status: Submitted [https://github.com/toddr/IO-Tty/pull/33]
17Signed-off-by: Khem Raj <raj.khem@gmail.com>
18---
19 Tty.xs | 10 +++++-----
20 1 file changed, 5 insertions(+), 5 deletions(-)
21
22diff --git a/Tty.xs b/Tty.xs
23index aa638f4..4bab39d 100644
24--- a/Tty.xs
25+++ b/Tty.xs
26@@ -186,11 +186,11 @@ mysignal(int sig, mysig_t act)
27 * will be copied. Always NUL terminates (unless siz == 0).
28 * Returns strlen(src); if retval >= siz, truncation occurred.
29 */
30-static size_t
31-strlcpy(dst, src, siz)
32- char *dst;
33- const char *src;
34- size_t siz;
35+size_t
36+strlcpy(
37+ char *dst,
38+ const char *src,
39+ size_t siz)
40 {
41 register char *d = dst;
42 register const char *s = src;
43--
442.37.3
45