diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/xfns.c b/src/xfns.c index 7dbf1e16c3a..5522684170f 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -6822,14 +6822,12 @@ mouse buttons are released on top of FRAME. */) | |||
| 6822 | { | 6822 | { |
| 6823 | struct frame *f = decode_window_system_frame (frame); | 6823 | struct frame *f = decode_window_system_frame (frame); |
| 6824 | int ntargets = 0, nnames = 0; | 6824 | int ntargets = 0, nnames = 0; |
| 6825 | ptrdiff_t len; | ||
| 6826 | char *target_names[2048]; | 6825 | char *target_names[2048]; |
| 6827 | Atom *target_atoms; | 6826 | Atom *target_atoms; |
| 6828 | Lisp_Object lval, original, tem, t1, t2; | 6827 | Lisp_Object lval, original, tem, t1, t2; |
| 6829 | Atom xaction; | 6828 | Atom xaction; |
| 6830 | Atom action_list[2048]; | 6829 | Atom action_list[2048]; |
| 6831 | char *name_list[2048]; | 6830 | char *name_list[2048]; |
| 6832 | char *scratch; | ||
| 6833 | 6831 | ||
| 6834 | USE_SAFE_ALLOCA; | 6832 | USE_SAFE_ALLOCA; |
| 6835 | 6833 | ||
| @@ -6843,10 +6841,8 @@ mouse buttons are released on top of FRAME. */) | |||
| 6843 | 6841 | ||
| 6844 | if (ntargets < 2048) | 6842 | if (ntargets < 2048) |
| 6845 | { | 6843 | { |
| 6846 | scratch = SSDATA (XCAR (targets)); | 6844 | SAFE_ALLOCA_STRING (target_names[ntargets], |
| 6847 | len = strlen (scratch); | 6845 | XCAR (targets)); |
| 6848 | target_names[ntargets] = SAFE_ALLOCA (len + 1); | ||
| 6849 | strncpy (target_names[ntargets], scratch, len + 1); | ||
| 6850 | ntargets++; | 6846 | ntargets++; |
| 6851 | } | 6847 | } |
| 6852 | else | 6848 | else |
| @@ -6896,10 +6892,8 @@ mouse buttons are released on top of FRAME. */) | |||
| 6896 | else | 6892 | else |
| 6897 | signal_error ("Invalid drag-and-drop action", tem); | 6893 | signal_error ("Invalid drag-and-drop action", tem); |
| 6898 | 6894 | ||
| 6899 | scratch = SSDATA (ENCODE_UTF_8 (t2)); | 6895 | SAFE_ALLOCA_STRING (name_list[nnames], |
| 6900 | len = strlen (scratch); | 6896 | ENCODE_SYSTEM (t2)); |
| 6901 | name_list[nnames] = SAFE_ALLOCA (len + 1); | ||
| 6902 | strncpy (name_list[nnames], scratch, len + 1); | ||
| 6903 | 6897 | ||
| 6904 | nnames++; | 6898 | nnames++; |
| 6905 | } | 6899 | } |