summaryrefslogtreecommitdiff
path: root/Documentation/technical/api-string-list.txt
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2012-09-12 14:04:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-09-12 18:43:25 (GMT)
commit51f3145c2834c8f1d94c5b7cf3790baf74b9f521 (patch)
tree860626fc159bd765a46945217325b603f991311e /Documentation/technical/api-string-list.txt
parentf103f95b11d087f07c0c48bf784cd9197e18f203 (diff)
downloadgit-51f3145c2834c8f1d94c5b7cf3790baf74b9f521.zip
git-51f3145c2834c8f1d94c5b7cf3790baf74b9f521.tar.gz
git-51f3145c2834c8f1d94c5b7cf3790baf74b9f521.tar.bz2
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 <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/technical/api-string-list.txt')
-rw-r--r--Documentation/technical/api-string-list.txt3
1 files changed, 1 insertions, 2 deletions
diff --git a/Documentation/technical/api-string-list.txt b/Documentation/technical/api-string-list.txt
index 32b35d9..155ac8c 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++)