From: Michael Haggerty Date: Wed, 12 Sep 2012 14:04:47 +0000 (+0200) Subject: api-string-list.txt: initialize the string_list the easy way X-Git-Tag: v1.8.0-rc0~46^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=51f3145c2834c8f1d94c5b7cf3790baf74b9f521;p=git.git api-string-list.txt: initialize the string_list the easy way In the demo code blurb, show how to initialize the string_list using STRING_LIST_INIT_NODUP rather than memset(). Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- diff --git a/Documentation/technical/api-string-list.txt b/Documentation/technical/api-string-list.txt index 32b35d918..155ac8cb1 100644 --- a/Documentation/technical/api-string-list.txt +++ b/Documentation/technical/api-string-list.txt @@ -44,10 +44,9 @@ member (you need this if you add things later) and you should set the Example: ---- -struct string_list list; +struct string_list list = STRING_LIST_INIT_NODUP; int i; -memset(&list, 0, sizeof(struct string_list)); string_list_append(&list, "foo"); string_list_append(&list, "bar"); for (i = 0; i < list.nr; i++)