aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2024-07-16 10:15:59 +0800
committerPo Lu2024-07-16 10:15:59 +0800
commit06ce99b76a8e5823f003f4e0dee945d97d0271ea (patch)
tree567d917f1bfe3682b9f131cabdc7a4dc134fb625 /src
parent0fc8d8836701f928a124ac13c32e6dae7f55ee37 (diff)
parent72c8e0df87b0776451f9065f3432a8ebecee974d (diff)
downloademacs-06ce99b76a8e5823f003f4e0dee945d97d0271ea.tar.gz
emacs-06ce99b76a8e5823f003f4e0dee945d97d0271ea.zip
Merge remote-tracking branch 'savannah/master' into master-android-1
Diffstat (limited to 'src')
-rw-r--r--src/eval.c8
-rw-r--r--src/image.c25
2 files changed, 11 insertions, 22 deletions
diff --git a/src/eval.c b/src/eval.c
index 1e0628b4aa3..2161ab1e1ea 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1857,14 +1857,6 @@ signal_or_quit (Lisp_Object error_symbol, Lisp_Object data, bool continuable)
1857 if (gc_in_progress || waiting_for_input) 1857 if (gc_in_progress || waiting_for_input)
1858 emacs_abort (); 1858 emacs_abort ();
1859 1859
1860#if 0 /* rms: I don't know why this was here,
1861 but it is surely wrong for an error that is handled. */
1862#ifdef HAVE_WINDOW_SYSTEM
1863 if (display_hourglass_p)
1864 cancel_hourglass ();
1865#endif
1866#endif
1867
1868 /* This hook is used by edebug. */ 1860 /* This hook is used by edebug. */
1869 if (! NILP (Vsignal_hook_function) 1861 if (! NILP (Vsignal_hook_function)
1870 && !oom) 1862 && !oom)
diff --git a/src/image.c b/src/image.c
index 3d761bd48be..90e6312e128 100644
--- a/src/image.c
+++ b/src/image.c
@@ -3525,8 +3525,9 @@ lookup_image (struct frame *f, Lisp_Object spec, int face_id)
3525 img->face_font_size = font_size; 3525 img->face_font_size = font_size;
3526 img->face_font_height = face->font->height; 3526 img->face_font_height = face->font->height;
3527 img->face_font_width = face->font->average_width; 3527 img->face_font_width = face->font->average_width;
3528 img->face_font_family = xmalloc (strlen (font_family) + 1); 3528 size_t len = strlen (font_family) + 1;
3529 strcpy (img->face_font_family, font_family); 3529 img->face_font_family = xmalloc (len);
3530 memcpy (img->face_font_family, font_family, len);
3530 img->load_failed_p = ! img->type->load_img (f, img); 3531 img->load_failed_p = ! img->type->load_img (f, img);
3531 3532
3532 /* If we can't load the image, and we don't have a width and 3533 /* If we can't load the image, and we don't have a width and
@@ -5544,15 +5545,13 @@ xpm_color_bucket (char *color_name)
5544static struct xpm_cached_color * 5545static struct xpm_cached_color *
5545xpm_cache_color (struct frame *f, char *color_name, XColor *color, int bucket) 5546xpm_cache_color (struct frame *f, char *color_name, XColor *color, int bucket)
5546{ 5547{
5547 size_t nbytes;
5548 struct xpm_cached_color *p;
5549
5550 if (bucket < 0) 5548 if (bucket < 0)
5551 bucket = xpm_color_bucket (color_name); 5549 bucket = xpm_color_bucket (color_name);
5552 5550
5553 nbytes = FLEXSIZEOF (struct xpm_cached_color, name, strlen (color_name) + 1); 5551 size_t len = strlen (color_name) + 1;
5554 p = xmalloc (nbytes); 5552 size_t nbytes = FLEXSIZEOF (struct xpm_cached_color, name, len);
5555 strcpy (p->name, color_name); 5553 struct xpm_cached_color *p = xmalloc (nbytes);
5554 memcpy (p->name, color_name, len);
5556 p->color = *color; 5555 p->color = *color;
5557 p->next = xpm_color_cache[bucket]; 5556 p->next = xpm_color_cache[bucket];
5558 xpm_color_cache[bucket] = p; 5557 xpm_color_cache[bucket] = p;
@@ -6249,9 +6248,7 @@ static const char xpm_color_key_strings[][4] = {"s", "m", "g4", "g", "c"};
6249static int 6248static int
6250xpm_str_to_color_key (const char *s) 6249xpm_str_to_color_key (const char *s)
6251{ 6250{
6252 int i; 6251 for (int i = 0; i < ARRAYELTS (xpm_color_key_strings); i++)
6253
6254 for (i = 0; i < ARRAYELTS (xpm_color_key_strings); i++)
6255 if (strcmp (xpm_color_key_strings[i], s) == 0) 6252 if (strcmp (xpm_color_key_strings[i], s) == 0)
6256 return i; 6253 return i;
6257 return -1; 6254 return -1;
@@ -10869,13 +10866,13 @@ static struct animation_cache *animation_cache = NULL;
10869static struct animation_cache * 10866static struct animation_cache *
10870imagemagick_create_cache (char *signature) 10867imagemagick_create_cache (char *signature)
10871{ 10868{
10869 size_t len = strlen (signature) + 1;
10872 struct animation_cache *cache 10870 struct animation_cache *cache
10873 = xmalloc (FLEXSIZEOF (struct animation_cache, signature, 10871 = xmalloc (FLEXSIZEOF (struct animation_cache, signature, len));
10874 strlen (signature) + 1));
10875 cache->wand = 0; 10872 cache->wand = 0;
10876 cache->index = 0; 10873 cache->index = 0;
10877 cache->next = 0; 10874 cache->next = 0;
10878 strcpy (cache->signature, signature); 10875 memcpy (cache->signature, signature, len);
10879 return cache; 10876 return cache;
10880} 10877}
10881 10878