[Pkg-libvirt-commits] [libguestfs] 11/78: utils: Remove for-loop variable decl.
Hilko Bengen
bengen at moszumanska.debian.org
Fri May 9 12:55:36 UTC 2014
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to branch experimental
in repository libguestfs.
commit bc1a4157941f482efebce19529dbad01537a0051
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Sat Mar 29 17:12:07 2014 +0000
utils: Remove for-loop variable decl.
Breaks Python distutils which doesn't use C99:
utils.c: In function ‘guestfs___copy_string_list’:
utils.c:79:7: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (size_t j = 0; j < i; ++j)
^
utils.c:79:7: note: use option -std=c99 or -std=gnu99 to compile your code
---
src/utils.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/utils.c b/src/utils.c
index 45adc3d..3ad0063 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -67,7 +67,7 @@ char **
guestfs___copy_string_list (char *const *argv)
{
size_t n = guestfs___count_strings (argv);
- size_t i;
+ size_t i, j;
char **ret;
ret = malloc ((n+1) * sizeof (char *));
@@ -78,7 +78,7 @@ guestfs___copy_string_list (char *const *argv)
for (i = 0; i < n; ++i) {
ret[i] = strdup (argv[i]);
if (ret[i] == NULL) {
- for (size_t j = 0; j < i; ++j)
+ for (j = 0; j < i; ++j)
free (ret[j]);
free (ret);
return NULL;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list