From 2881d173b5d10cb823244a3a3e04698838e9e64f Mon Sep 17 00:00:00 2001 From: Michael Elkins Date: Tue, 13 Nov 2001 00:36:44 +0000 Subject: [PATCH] strndup() could return a non-NULL terminated string size_t should be printed with %lu when expending tildes (~), an extra slash was inserted after the user's home directory --- config.c | 3 +++ sync.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config.c b/config.c index b5687fc..ceb70ec 100644 --- a/config.c +++ b/config.c @@ -79,7 +79,10 @@ expand_strdup (const char *s) p = strchr (s, '/'); if (p) + { user = strndup (s, (int)(p - s)); + p++; + } else user = strdup (s); pw = getpwnam (user); diff --git a/sync.c b/sync.c index 3450278..2f19689 100644 --- a/sync.c +++ b/sync.c @@ -117,7 +117,7 @@ sync_mailbox (mailbox_t * mbox, imap_t * imap, int flags, { if ((flags & SYNC_QUIET) == 0) printf - ("Warning, local message is too large (%ld), skipping...\n", + ("Warning, local message is too large (%lu), skipping...\n", sb.st_size); continue; }