diff options
-rw-r--r-- | libmate-desktop/mate-desktop-thumbnail.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libmate-desktop/mate-desktop-thumbnail.c b/libmate-desktop/mate-desktop-thumbnail.c index 4ef0b52..c1ec81b 100644 --- a/libmate-desktop/mate-desktop-thumbnail.c +++ b/libmate-desktop/mate-desktop-thumbnail.c @@ -1398,7 +1398,7 @@ mate_desktop_thumbnail_factory_save_thumbnail (MateDesktopThumbnailFactory *fact char *tmp_path; const char *width, *height; int tmp_fd; - char mtime_str[21]; + gchar *mtime_str; gboolean saved_ok; GChecksum *checksum; guint8 digest[16]; @@ -1443,7 +1443,7 @@ mate_desktop_thumbnail_factory_save_thumbnail (MateDesktopThumbnailFactory *fact } close (tmp_fd); - g_snprintf (mtime_str, 21, "%ld", original_mtime); + mtime_str = g_strdup_printf ("%" G_GINT64_FORMAT, (gint64)original_mtime); width = gdk_pixbuf_get_option (thumbnail, "tEXt::Thumb::Image::Width"); height = gdk_pixbuf_get_option (thumbnail, "tEXt::Thumb::Image::Height"); @@ -1481,6 +1481,7 @@ mate_desktop_thumbnail_factory_save_thumbnail (MateDesktopThumbnailFactory *fact g_clear_error (&error); } + g_free (mtime_str); g_free (path); g_free (tmp_path); } @@ -1506,7 +1507,7 @@ mate_desktop_thumbnail_factory_create_failed_thumbnail (MateDesktopThumbnailFact char *path, *file; char *tmp_path; int tmp_fd; - char mtime_str[21]; + gchar *mtime_str; gboolean saved_ok; GdkPixbuf *pixbuf; GChecksum *checksum; @@ -1549,7 +1550,7 @@ mate_desktop_thumbnail_factory_create_failed_thumbnail (MateDesktopThumbnailFact } close (tmp_fd); - g_snprintf (mtime_str, 21, "%ld", mtime); + mtime_str = g_strdup_printf ("%" G_GINT64_FORMAT, (gint64)mtime); pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, 1, 1); saved_ok = gdk_pixbuf_save (pixbuf, tmp_path, @@ -1559,6 +1560,7 @@ mate_desktop_thumbnail_factory_create_failed_thumbnail (MateDesktopThumbnailFact "tEXt::Software", "MATE::ThumbnailFactory", NULL); g_object_unref (pixbuf); + g_free (mtime_str); if (saved_ok) { g_chmod (tmp_path, 0600); @@ -1677,7 +1679,7 @@ mate_desktop_thumbnail_is_valid (GdkPixbuf *pixbuf, thumb_mtime_str = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::MTime"); if (!thumb_mtime_str) return FALSE; - thumb_mtime = atol (thumb_mtime_str); + thumb_mtime = (time_t)g_ascii_strtoll (thumb_mtime_str, (gchar**)NULL, 10); if (mtime != thumb_mtime) return FALSE; |