aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/image.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/image.c b/src/image.c
index d8c34669cc4..6ecf6a70fe2 100644
--- a/src/image.c
+++ b/src/image.c
@@ -8276,11 +8276,13 @@ gif_load (struct frame *f, struct image *img)
8276 if (gif == NULL) 8276 if (gif == NULL)
8277 { 8277 {
8278#if HAVE_GIFERRORSTRING 8278#if HAVE_GIFERRORSTRING
8279 image_error ("Cannot open `%s': %s", 8279 const char *errstr = GifErrorString (gif_err);
8280 file, build_string (GifErrorString (gif_err))); 8280 if (errstr)
8281#else 8281 image_error ("Cannot open `%s': %s", file, build_string (errstr));
8282 image_error ("Cannot open `%s'", file); 8282 else
8283#endif 8283#endif
8284 image_error ("Cannot open `%s'", file);
8285
8284 return 0; 8286 return 0;
8285 } 8287 }
8286 } 8288 }
@@ -8306,11 +8308,13 @@ gif_load (struct frame *f, struct image *img)
8306 if (!gif) 8308 if (!gif)
8307 { 8309 {
8308#if HAVE_GIFERRORSTRING 8310#if HAVE_GIFERRORSTRING
8309 image_error ("Cannot open memory source `%s': %s", 8311 const char *errstr = GifErrorString (gif_err);
8310 img->spec, build_string (GifErrorString (gif_err))); 8312 if (errstr)
8311#else 8313 image_error ("Cannot open memory source `%s': %s",
8312 image_error ("Cannot open memory source `%s'", img->spec); 8314 img->spec, build_string (errstr));
8315 else
8313#endif 8316#endif
8317 image_error ("Cannot open memory source `%s'", img->spec);
8314 return 0; 8318 return 0;
8315 } 8319 }
8316 } 8320 }
@@ -8593,9 +8597,9 @@ gif_load (struct frame *f, struct image *img)
8593 if (error_text) 8597 if (error_text)
8594 image_error ("Error closing `%s': %s", 8598 image_error ("Error closing `%s': %s",
8595 img->spec, build_string (error_text)); 8599 img->spec, build_string (error_text));
8596#else 8600 else
8597 image_error ("Error closing `%s'", img->spec);
8598#endif 8601#endif
8602 image_error ("Error closing `%s'", img->spec);
8599 } 8603 }
8600 8604
8601 /* Maybe fill in the background field while we have ximg handy. */ 8605 /* Maybe fill in the background field while we have ximg handy. */