Code Review
/
src
/
app-framework-binder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
afb-migration-to-binding-v3: fix broken links
[src/app-framework-binder.git]
/
src
/
locale-root.c
diff --git
a/src/locale-root.c
b/src/locale-root.c
index
1d255bf
..
4d141b8
100644
(file)
--- a/
src/locale-root.c
+++ b/
src/locale-root.c
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2015-201
8
"IoT.bzh"
+ Copyright (C) 2015-201
9
"IoT.bzh"
author: José Bollo <jose.bollo@iot.bzh>
author: José Bollo <jose.bollo@iot.bzh>
@@
-47,7
+47,7
@@
static const char locales[] = "locales/";
struct locale_folder {
struct locale_folder *parent;
size_t length;
struct locale_folder {
struct locale_folder *parent;
size_t length;
- char name[
1
];
+ char name[];
};
struct locale_container {
};
struct locale_container {
@@
-67,7
+67,7
@@
struct locale_search {
struct locale_root *root;
struct locale_search_node *head;
int refcount;
struct locale_root *root;
struct locale_search_node *head;
int refcount;
- char definition[
1
];
+ char definition[];
};
struct locale_root {
};
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);
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;
if (folders[count] != NULL) {
folders[count]->parent = NULL;
folders[count]->length = length;
@@
-157,7
+157,7
@@
static struct locale_folder *search_folder(struct locale_container *container, c
*/
static int init_container(struct locale_container *container, int dirfd)
{
*/
static int init_container(struct locale_container *container, int dirfd)
{
- int rc, sfd;
+ int rc
= 0
, sfd;
DIR *dir;
struct dirent *dent;
struct stat st;
DIR *dir;
struct dirent *dent;
struct stat st;
@@
-362,7
+362,7
@@
static struct locale_search *create_search(struct locale_root *root, const char
struct locale_search_node *node;
/* allocate the structure */
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 {
if (search == NULL) {
errno = ENOMEM;
} else {