aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog4
-rw-r--r--mail/mail-display.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 14ee1c83b2..af9da6c5f5 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,9 @@
2002-08-28 Jeffrey Stedfast <fejj@ximian.com>
+ * mail-display.c (make_safe_filename): Fix some broken logic here,
+ `p = strrchr (path, '/') + 1` will *never* be NULL!! If the
+ strrchr returns NULL, then that expression will evaluate to 0x1!!
+
* main.c (main): We now always need to init gconf for our later
call to e_proxy_init() which initialises the proxy settings for
soup to use.
diff --git a/mail/mail-display.c b/mail/mail-display.c
index 9681be7b1f..9f3ad1c84b 100644
--- a/mail/mail-display.c
+++ b/mail/mail-display.c
@@ -226,9 +226,9 @@ make_safe_filename (const char *prefix,CamelMimePart *part)
else
safe = g_strdup_printf ("%s/%s", prefix, name);
- p = strrchr (safe, '/') + 1;
+ p = strrchr (safe, '/');
if (p)
- e_filename_make_safe (p);
+ e_filename_make_safe (p + 1);
return safe;
}