aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-13 12:25:15 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-13 12:25:15 +0000
commitd4cf291ff5288e7d9823d2e732415e839dfe88d9 (patch)
treea058efc673804b7c0a9395d006fac7e0cb56f6e9 /file.c
parent7f666186cbeec2708244f2d18f04e999ef3d917b (diff)
downloadruby-d4cf291ff5288e7d9823d2e732415e839dfe88d9.tar.gz
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
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/file.c b/file.c
index 91df3c34c6..5947b3f68b 100644
--- a/file.c
+++ b/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;