mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
file.c (struct apply_arg): Use FLEX_ARY_LEN
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ccc5c73258
commit
879df66d96
1 changed files with 2 additions and 2 deletions
4
file.c
4
file.c
|
@ -361,7 +361,7 @@ struct apply_arg {
|
|||
int errnum;
|
||||
int (*func)(const char *, void *);
|
||||
void *arg;
|
||||
struct apply_filename fn[1]; /* flexible array */
|
||||
struct apply_filename fn[FLEX_ARY_LEN];
|
||||
};
|
||||
|
||||
static void *
|
||||
|
@ -388,7 +388,7 @@ apply2files(int (*func)(const char *, void *), int argc, VALUE *argv, void *arg)
|
|||
{
|
||||
VALUE v;
|
||||
const size_t size = sizeof(struct apply_filename);
|
||||
const long len = (long)(offsetof(struct apply_arg, fn) + (size * argc));
|
||||
const long len = (long)(sizeof(struct apply_arg) + (size * argc));
|
||||
struct apply_arg *aa = ALLOCV(v, len);
|
||||
|
||||
aa->errnum = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue