Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
kconfig: incorrect 'len' field initialisation ?
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tititiou36 authored and sravnborg committed May 19, 2008
1 parent 7b97887 commit 107f43a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/kconfig/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 107f43a

Please sign in to comment.