X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=src%2Fapp-framework-binder.git;a=blobdiff_plain;f=src%2Flocale-root.c;fp=src%2Flocale-root.c;h=c1e27bbd7cd49005ff711b0fd1b86ee344139973;hp=40cd050cfac09d2e63ec02a542e1bda4766fb7fe;hb=bc8929bec96e81a7f487d5689f52335b435f0e3e;hpb=75a6b9e42432e3503a69013624c786af35aed7af diff --git a/src/locale-root.c b/src/locale-root.c index 40cd050c..c1e27bbd 100644 --- a/src/locale-root.c +++ b/src/locale-root.c @@ -47,7 +47,7 @@ static const char locales[] = "locales/"; struct locale_folder { struct locale_folder *parent; size_t length; - char name[1]; + char name[]; }; struct locale_container { @@ -67,7 +67,7 @@ struct locale_search { struct locale_root *root; struct locale_search_node *head; int refcount; - char definition[1]; + char definition[]; }; struct locale_root { @@ -102,7 +102,7 @@ static int add_folder(struct locale_container *container, const char *name) 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; @@ -362,7 +362,7 @@ static struct locale_search *create_search(struct locale_root *root, const char 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 {