[Grubby - PATCH 4/4] Avoid C99 declaration inside for-loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Avoids declaring an integer variable inside the initializer of a for-loop.
This patch avoids needing to compile the source in C99 mode.
---
 grubby.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/grubby.c b/grubby.c
index 4866f1d..d0101cd 100644
--- a/grubby.c
+++ b/grubby.c
@@ -2423,9 +2423,10 @@ static void requote(struct singleLine *tmplLine, struct configFileInfo * cfi)
 	    quoteLen += strlen(tmplLine->elements[j].indent);
 	    
 	    if (isquote(tmplLine->elements[j].item[itemlen - 1])) {
+		int i;
 		c = malloc(quoteLen + 1);
 		c[0] = '\0';
-		for (int i = firstQuotedItem; i < j+1; i++) {
+		for (i = firstQuotedItem; i < j+1; i++) {
 		    strcat(c, tmplLine->elements[i].item);
 		    strcat(c, tmplLine->elements[i].indent);
 		}
-- 
1.7.10.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux