mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
string.c: fix zero-length array
* string.c (mapping_buffer): get rid of zero-length array member, which is not a part of C90. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f2a1f32f48
commit
78b0d7ac1c
1 changed files with 2 additions and 2 deletions
4
string.c
4
string.c
|
|
@ -5897,7 +5897,7 @@ typedef struct mapping_buffer {
|
|||
size_t capa;
|
||||
size_t used;
|
||||
struct mapping_buffer *next;
|
||||
OnigUChar space[0];
|
||||
OnigUChar space[1];
|
||||
} mapping_buffer;
|
||||
|
||||
static VALUE
|
||||
|
|
@ -5923,7 +5923,7 @@ rb_str_casemap(VALUE source, OnigCaseFoldType *flags, rb_encoding *enc)
|
|||
if (CASEMAP_DEBUG) {
|
||||
fprintf(stderr, "Buffer allocation, capa is %"PRIuSIZE"\n", capa); /* for tuning */
|
||||
}
|
||||
current_buffer->next = (mapping_buffer*)ALLOC_N(char, sizeof(mapping_buffer)+capa);
|
||||
current_buffer->next = (mapping_buffer*)ALLOC_N(char, offsetof(mapping_buffer, space)+capa);
|
||||
current_buffer = current_buffer->next;
|
||||
current_buffer->next = NULL;
|
||||
current_buffer->capa = capa;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue