#include <system.h>
#include <areadlink.h>
+#include <flexmember.h>
#include <quotearg.h>
#include "common.h"
dev_t dev;
ino_t ino;
nlink_t nlink;
- char name[1];
+ char name[FLEXIBLE_ARRAY_MEMBER];
};
struct exclusion_tag
absolute_names_option));
transform_name (&linkname, XFORM_LINK);
- lp = xmalloc (offsetof (struct link, name)
- + strlen (linkname) + 1);
+ lp = xmalloc (FLEXNSIZEOF (struct link, name, strlen (linkname) + 1));
lp->ino = st->stat.st_ino;
lp->dev = st->stat.st_dev;
lp->nlink = st->stat.st_nlink;
*/
#include <system.h>
#include <quotearg.h>
+#include <flexmember.h>
#include <fnmatch.h>
#include <wordsplit.h>
#include "common.h"
{
struct excfile *next;
int flags;
- char name[1];
+ char name[FLEXIBLE_ARRAY_MEMBER];
};
static struct excfile *excfile_head, *excfile_tail;
void
excfile_add (const char *name, int flags)
{
- struct excfile *p = xmalloc (sizeof (*p) + strlen (name));
+ struct excfile *p = xmalloc (FLEXNSIZEOF (struct excfile, name,
+ strlen (name) + 1));
p->next = NULL;
p->flags = flags;
strcpy (p->name, name);
#include <system.h>
#include <quotearg.h>
#include <errno.h>
+#include <flexmember.h>
#include <hash.h>
#include <priv-set.h>
#include <root-uid.h>
struct xattr_map xattr_map;
/* The desired target of the desired link. */
- char target[1];
+ char target[FLEXIBLE_ARRAY_MEMBER];
};
static Hash_table *delayed_link_table;
struct string_list
{
struct string_list *next;
- char string[1];
+ char string[FLEXIBLE_ARRAY_MEMBER];
};
static size_t
status = 0;
break;
}
-
+
errno = EEXIST;
}
p->mtime = current_stat_info.mtime;
}
p->change_dir = chdir_current;
- p->sources = xmalloc (offsetof (struct string_list, string)
- + strlen (file_name) + 1);
+ p->sources = xmalloc (FLEXNSIZEOF (struct string_list, string,
+ strlen (file_name) + 1));
p->sources->next = 0;
strcpy (p->sources->string, file_name);
p->cntx_name = NULL;
if (ds && ds->change_dir == chdir_current
&& BIRTHTIME_EQ (ds->birthtime, get_stat_birthtime (&st1)))
{
- struct string_list *p = xmalloc (offsetof (struct string_list, string)
- + strlen (file_name) + 1);
+ struct string_list *p
+ = xmalloc (FLEXNSIZEOF (struct string_list,
+ string, strlen (file_name) + 1));
strcpy (p->string, file_name);
p->next = ds->sources;
ds->sources = p;