summaryrefslogtreecommitdiffstats
path: root/recipes/samba/samba-3.0.34/uclibc-strlcpy-strlcat.patch
blob: b10a1b1084ab6a5c5ae93016b386f7acaaab1bed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
diff --git source.old/client/mount.cifs.c source/client/mount.cifs.c
index 3b56e5f..b7a76c6 100644
--- source.old/client/mount.cifs.c
+++ source/client/mount.cifs.c
@@ -56,6 +56,10 @@
  #endif /* _SAMBA_BUILD_ */
 #endif /* MOUNT_CIFS_VENDOR_SUFFIX */
 
+#ifdef _SAMBA_BUILD_
+#include "include/config.h"
+#endif
+
 #ifndef MS_MOVE 
 #define MS_MOVE 8192 
 #endif 
@@ -94,6 +98,8 @@ char * prefixpath = NULL;
 
 /* like strncpy but does not 0 fill the buffer and always null
  *    terminates. bufsize is the size of the destination buffer */
+
+#ifndef HAVE_STRLCPY
 static size_t strlcpy(char *d, const char *s, size_t bufsize)
 {
 	size_t len = strlen(s);
@@ -104,10 +110,13 @@ static size_t strlcpy(char *d, const char *s, size_t bufsize)
 	d[len] = 0;
 	return ret;
 }
+#endif
 
 /* like strncat but does not 0 fill the buffer and always null
  *    terminates. bufsize is the length of the buffer, which should
  *       be one more than the maximum resulting string length */
+
+#ifndef HAVE_STRLCAT
 static size_t strlcat(char *d, const char *s, size_t bufsize)
 {
 	size_t len1 = strlen(d);
@@ -126,6 +135,7 @@ static size_t strlcat(char *d, const char *s, size_t bufsize)
 	}
 	return ret;
 }
+#endif
 
 /* BB finish BB