diff options
| author | Paul Eggert | 2015-07-31 09:46:45 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-07-31 09:47:19 -0700 |
| commit | 8a7a99e0280103e223b8e1a717107bdf9b8eabc7 (patch) | |
| tree | bd6794e32994e43745d8764fc252f98c458b7562 /src/xrdb.c | |
| parent | f5fc5cd5c207a4fc3bdde381ad4f74c8fe6bb5d6 (diff) | |
| download | emacs-8a7a99e0280103e223b8e1a717107bdf9b8eabc7.tar.gz emacs-8a7a99e0280103e223b8e1a717107bdf9b8eabc7.zip | |
Port to pedantic memcpy
* src/keyboard.c (menu_bar_items, tool_bar_items):
* src/xrdb.c (magic_db):
Port to pedantic memcpy implementations that reject memcpy (0, 0, 0).
Diffstat (limited to 'src/xrdb.c')
| -rw-r--r-- | src/xrdb.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/xrdb.c b/src/xrdb.c index 9e85e5a6277..2235b4535da 100644 --- a/src/xrdb.c +++ b/src/xrdb.c | |||
| @@ -119,8 +119,8 @@ magic_db (const char *string, ptrdiff_t string_len, const char *class, | |||
| 119 | while (p < string + string_len) | 119 | while (p < string + string_len) |
| 120 | { | 120 | { |
| 121 | /* The chunk we're about to stick on the end of result. */ | 121 | /* The chunk we're about to stick on the end of result. */ |
| 122 | const char *next = NULL; | 122 | const char *next = p; |
| 123 | ptrdiff_t next_len; | 123 | ptrdiff_t next_len = 1; |
| 124 | 124 | ||
| 125 | if (*p == '%') | 125 | if (*p == '%') |
| 126 | { | 126 | { |
| @@ -137,10 +137,13 @@ magic_db (const char *string, ptrdiff_t string_len, const char *class, | |||
| 137 | break; | 137 | break; |
| 138 | 138 | ||
| 139 | case 'C': | 139 | case 'C': |
| 140 | next = (x_customization_string | 140 | if (x_customization_string) |
| 141 | ? x_customization_string | 141 | { |
| 142 | : ""); | 142 | next = x_customization_string; |
| 143 | next_len = strlen (next); | 143 | next_len = strlen (next); |
| 144 | } | ||
| 145 | else | ||
| 146 | next_len = 0; | ||
| 144 | break; | 147 | break; |
| 145 | 148 | ||
| 146 | case 'N': | 149 | case 'N': |
| @@ -176,8 +179,6 @@ magic_db (const char *string, ptrdiff_t string_len, const char *class, | |||
| 176 | return NULL; | 179 | return NULL; |
| 177 | } | 180 | } |
| 178 | } | 181 | } |
| 179 | else | ||
| 180 | next = p, next_len = 1; | ||
| 181 | 182 | ||
| 182 | /* Do we have room for this component followed by a '\0'? */ | 183 | /* Do we have room for this component followed by a '\0'? */ |
| 183 | if (path_size - path_len <= next_len) | 184 | if (path_size - path_len <= next_len) |