mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
kconfig: incorrect 'len' field initialisation ?
1) The field 'len' of the 'gstr' structure seems to track the size of the memory already allocated for the "growable string". So the value of this field should be the same as the 'malloc()' just above, shouldn't it ? Signed-off-by: Christophe Jaillet <christophe.jaillet@wanadoo.fr> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
This commit is contained in:
parent
7b97887eab
commit
107f43a0f7
1 changed files with 1 additions and 1 deletions
|
@ -77,7 +77,7 @@ struct gstr str_new(void)
|
|||
{
|
||||
struct gstr gs;
|
||||
gs.s = malloc(sizeof(char) * 64);
|
||||
gs.len = 16;
|
||||
gs.len = 64;
|
||||
strcpy(gs.s, "\0");
|
||||
return gs;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue