summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Niestroj <m.niestroj@grinn-global.com>2017-06-23 12:18:47 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-06-27 08:32:34 +0200
commitba0b35b84bee76fae08171266d68e85da65f778c (patch)
tree9e080e150814d6de2a5cf27d004d88754d49a6bd
parentbfb82d544d6b8000bce57c45c52a4008289da856 (diff)
downloaddt-utils-ba0b35b84bee76fae08171266d68e85da65f778c.tar.gz
dt-utils-ba0b35b84bee76fae08171266d68e85da65f778c.tar.xz
common: Rename strlcpy to DT_strlcpy
strlcpy function is defined in uClibc library, causing "static declaration of ‘strlcpy’ follows non-static declaration" build errors. Rename internal strlcpy function to DT_strlcpy to avoid conflicts. Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--src/dt/common.h4
-rw-r--r--src/libdt.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/dt/common.h b/src/dt/common.h
index f6bad44..992e28f 100644
--- a/src/dt/common.h
+++ b/src/dt/common.h
@@ -168,7 +168,7 @@ static inline char *barebox_asprintf(const char *fmt, ...)
#define basprintf(fmt, arg...) barebox_asprintf(fmt, ##arg)
/**
- * strlcpy - Copy a %NUL terminated string into a sized buffer
+ * DT_strlcpy - Copy a %NUL terminated string into a sized buffer
* @dest: Where to copy the string to
* @src: Where to copy the string from
* @size: size of destination buffer
@@ -178,7 +178,7 @@ static inline char *barebox_asprintf(const char *fmt, ...)
* of course, the buffer size is zero). It does not pad
* out the result like strncpy() does.
*/
-static inline size_t strlcpy(char *dest, const char *src, size_t size)
+static inline size_t DT_strlcpy(char *dest, const char *src, size_t size)
{
size_t ret = strlen(src);
diff --git a/src/libdt.c b/src/libdt.c
index 4db5160..3adeed2 100644
--- a/src/libdt.c
+++ b/src/libdt.c
@@ -1503,7 +1503,7 @@ int of_modalias_node(struct device_node *node, char *modalias, int len)
if (!compatible || strlen(compatible) > cplen)
return -ENODEV;
p = strchr(compatible, ',');
- strlcpy(modalias, p ? p + 1 : compatible, len);
+ DT_strlcpy(modalias, p ? p + 1 : compatible, len);
return 0;
}