/*
- Copyright (C) 2015-2018 "IoT.bzh"
+ Copyright (C) 2015-2019 "IoT.bzh"
author: José Bollo <jose.bollo@iot.bzh>
struct locale_folder {
struct locale_folder *parent;
size_t length;
- char name[1];
+ char name[];
};
struct locale_container {
struct locale_root *root;
struct locale_search_node *head;
int refcount;
- char definition[1];
+ char definition[];
};
struct locale_root {
if (folders != NULL) {
container->folders = folders;
length = strlen(name);
- folders[count] = malloc(sizeof **folders + length);
+ folders[count] = malloc(sizeof **folders + 1 + length);
if (folders[count] != NULL) {
folders[count]->parent = NULL;
folders[count]->length = length;
struct locale_search_node *node;
/* allocate the structure */
- search = malloc(sizeof *search + length);
+ search = malloc(sizeof *search + 1 + length);
if (search == NULL) {
errno = ENOMEM;
} else {