From 7f33676ea560fd167ab48fb8c3b27a582ac7fbf4 Mon Sep 17 00:00:00 2001 From: Stathis Kamperis Date: Sun, 20 Jan 2008 18:23:23 +0100 Subject: [PATCH] Minor cleanup * Add comment regarding setprogname() * Simplify code in iteration of array elements --- proplib/prop_array2.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/proplib/prop_array2.c b/proplib/prop_array2.c index 4502690..2d0b604 100644 --- a/proplib/prop_array2.c +++ b/proplib/prop_array2.c @@ -16,7 +16,7 @@ int main(int argc, char *argv[]) unsigned int i; const char *s; - /* */ + /* No effect in NetBSD, but increases portability */ setprogname(argv[0]); /* Check argument count */ @@ -47,8 +47,10 @@ int main(int argc, char *argv[]) } /* Traverse */ - while((po = prop_object_iterator_next(pit)) != NULL) - printf("%s\n", prop_string_cstring_nocopy(po)); + while((po = prop_object_iterator_next(pit)) != NULL) { + s = prop_string_cstring_nocopy(po); + printf("%s\n", s); + } /* Release objects */ prop_object_release(pa); -- 2.11.4.GIT