aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-09-26 22:28:46 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-09-26 22:28:46 +0000
commitbac96e9f495eda8b147170a11d051b139884ad41 (patch)
tree14c2e389fcf0d415c0b49792472835702bf6b08f /lib
parent00505c9247f11ec2004de52d153df73499d136d7 (diff)
Added strlcpy() since it turns out some krb4-implementations don't include
their own, even if mine did!
Diffstat (limited to 'lib')
-rw-r--r--lib/krb4.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/krb4.c b/lib/krb4.c
index 79b968c1a..212b0952d 100644
--- a/lib/krb4.c
+++ b/lib/krb4.c
@@ -72,6 +72,27 @@ struct krb4_data {
char realm[REALM_SZ];
};
+#ifndef HAVE_STRLCPY
+
+size_t
+strlcpy (char *dst, const char *src, size_t dst_sz)
+{
+ size_t n;
+ char *p;
+
+ for (p = dst, n = 0;
+ n + 1 < dst_sz && *src != '\0';
+ ++p, ++src, ++n)
+ *p = *src;
+ *p = '\0';
+ if (*src == '\0')
+ return n;
+ else
+ return n + strlen (src);
+}
+
+#endif
+
static int
krb4_check_prot(void *app_data, int level)
{