make m_dupstr return NULL if the string was empty.
[apps/madmutt.git] / imap / util.c
index 63dd769..8e6832b 100644 (file)
@@ -443,7 +443,7 @@ void imap_unmunge_mbox_name (char *s)
   buf = m_strdup(s);
   if (buf) {
     imap_utf7_decode (&buf);
-    strncpy (s, buf, m_strlen(s));
+    m_strcpy(s, m_strlen(s) + 1, buf);
   }
 
   p_delete(&buf);