diff options
| author | Paul Eggert | 2024-04-30 01:20:12 -0700 |
|---|---|---|
| committer | Paul Eggert | 2024-04-30 01:26:22 -0700 |
| commit | 98d0fc989a00dda19412ec5cd3ebe9fb4f276521 (patch) | |
| tree | 40bc56337b244a60324d29c0c72ae4c855fe2edb | |
| parent | ca4f0705be544986f11971bd8ee7dc30a8d444f1 (diff) | |
| download | emacs-98d0fc989a00dda19412ec5cd3ebe9fb4f276521.tar.gz emacs-98d0fc989a00dda19412ec5cd3ebe9fb4f276521.zip | |
Pacify GCC 14 -Walloc-size
* src/xfns.c (xic_string_conversion_callback): Allocate size 1, not 0.
| -rw-r--r-- | src/xfns.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/xfns.c b/src/xfns.c index d610c839bfc..67db461a379 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -3917,11 +3917,12 @@ xic_string_conversion_callback (XIC ic, XPointer client_data, | |||
| 3917 | return; | 3917 | return; |
| 3918 | 3918 | ||
| 3919 | failure: | 3919 | failure: |
| 3920 | /* Return a string of length 0 using the C library malloc. This | 3920 | /* Return a string of length 0 using the C library malloc (1) |
| 3921 | (not malloc (0), to pacify gcc -Walloc-size). This | ||
| 3921 | assumes XFree is able to free data allocated with our malloc | 3922 | assumes XFree is able to free data allocated with our malloc |
| 3922 | wrapper. */ | 3923 | wrapper. */ |
| 3923 | call_data->text->length = 0; | 3924 | call_data->text->length = 0; |
| 3924 | call_data->text->string.mbs = malloc (0); | 3925 | call_data->text->string.mbs = malloc (1); |
| 3925 | } | 3926 | } |
| 3926 | 3927 | ||
| 3927 | #endif /* HAVE_X_I18N */ | 3928 | #endif /* HAVE_X_I18N */ |