[cowdancer] 02/05: qemubuilder.c: Change for-loops to be C89-compliant

James Clarke jrtc27 at moszumanska.debian.org
Wed Jan 18 18:50:40 UTC 2017


This is an automated email from the git hooks/post-receive script.

jrtc27 pushed a commit to branch master
in repository cowdancer.

commit 96589412769a41d905d1e8bd329d9ffe634c22d9
Author: James Clarke <jrtc27 at debian.org>
Date:   Wed Jan 18 16:46:01 2017 +0000

    qemubuilder.c: Change for-loops to be C89-compliant
---
 qemubuilder.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/qemubuilder.c b/qemubuilder.c
index 7c273d0..340bc5b 100644
--- a/qemubuilder.c
+++ b/qemubuilder.c
@@ -159,6 +159,7 @@ static int loop_umount(const char *device) {
 @returns NULL on failure, FILE* on success
 */
 static FILE *create_script(const char *mountpoint, const char *relative_path) {
+	char *c;
 	char *s = NULL;
 	FILE *f = NULL;
 	FILE *ret = NULL;
@@ -166,7 +167,7 @@ static FILE *create_script(const char *mountpoint, const char *relative_path) {
 	asprintf(&s, "%s/%s", mountpoint, relative_path);
 
 	/* Create directories in relative_path */
-	for (char *c = s + strlen(mountpoint) + 1; *c; ++c) {
+	for (c = s + strlen(mountpoint) + 1; *c; ++c) {
 		if (*c != '/') {
 			continue;
 		}
@@ -380,7 +381,8 @@ static const char *format_for_image(const char *file) {
 		{".qemu", "raw"}
 	};
 	int file_len = strlen(file);
-	for (int i = 0; i < sizeof(formats) / sizeof(formats[0]); ++i) {
+	int i;
+	for (i = 0; i < sizeof(formats) / sizeof(formats[0]); ++i) {
 		const char *ext = formats[i][0];
 		const char *format = formats[i][1];
 		int ext_len = strlen(ext);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pbuilder/cowdancer.git



More information about the Pbuilder-maint mailing list