summaryrefslogtreecommitdiff
path: root/mailcheck.c
diff options
context:
space:
mode:
Diffstat (limited to 'mailcheck.c')
-rw-r--r--mailcheck.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mailcheck.c b/mailcheck.c
index 15890127..8d3f833d 100644
--- a/mailcheck.c
+++ b/mailcheck.c
@@ -291,9 +291,10 @@ make_default_mailpath ()
{
char *mp;
- mp = xmalloc (1 + sizeof (DEFAULT_MAIL_DIRECTORY) + strlen (current_user.user_name));
+ mp = xmalloc (2 + sizeof (DEFAULT_MAIL_DIRECTORY) + strlen (current_user.user_name));
strcpy (mp, DEFAULT_MAIL_DIRECTORY);
- strcpy (mp + sizeof (DEFAULT_MAIL_DIRECTORY) - 1, current_user.user_name);
+ mp[sizeof(DEFAULT_MAIL_DIRECTORY) - 1] = '/';
+ strcpy (mp + sizeof (DEFAULT_MAIL_DIRECTORY), current_user.user_name);
return (mp);
}