move variable declarations out of the 'for' loop

this fixes compilation with gcc-4.8
diff --git a/src/diag_dpl.c b/src/diag_dpl.c
index b9fd901..b5a1bb0 100644
--- a/src/diag_dpl.c
+++ b/src/diag_dpl.c
@@ -97,11 +97,12 @@
 	struct msgb *msg = msgb_alloc_diag();
 	struct dpl_set_if_log_req *silr;
 	struct msgb *rx;
+	int i;
 
 	silr = (struct dpl_set_if_log_req *) msgb_put(msg, sizeof(*silr));
 	silr->iface_id = iface_id;
 	silr->num_log_flags = 0;
-	for (int i = 0; i < 1; i++) {
+	for (i = 0; i < 1; i++) {
 		msgb_put(msg, sizeof(silr->log_flags[0]));
 		silr->num_log_flags++;
 		iid.link_instance = i;
diff --git a/src/diag_msg.c b/src/diag_msg.c
index 4d79b7f..1067b03 100644
--- a/src/diag_msg.c
+++ b/src/diag_msg.c
@@ -86,6 +86,7 @@
 	struct ext_log_msg *msg;
 	char *file = NULL, *fmt;
 	unsigned int num_args;
+	char *cur;
 
 	if (len < sizeof(struct ext_log_msg)) {
 		printf("too short ext_log_msg.\n");
@@ -102,7 +103,7 @@
 		file, osmo_load16le(&msg->line_nr));
 
 	/* replace all '%s' with '%p', as %s obviously doesn't work */
-	for (char *cur = strstr(fmt, "%s"); cur && (cur < fmt + strlen(fmt)); cur = strstr(fmt, "%s")) {
+	for (cur = strstr(fmt, "%s"); cur && (cur < fmt + strlen(fmt)); cur = strstr(fmt, "%s")) {
 		cur[1] = 'p';
 	}