Git-Url:
http://git.frugalware.org/gitweb/gitweb.cgi?p=gfpm.git;a=commitdiff;h=c64eb09f6ef89fc04461c84dec83f548e2a83c5c
commit c64eb09f6ef89fc04461c84dec83f548e2a83c5c
Author: Priyank <[EMAIL PROTECTED]>
Date: Sun Feb 10 11:09:09 2008 +0530
gfpm-repomanager: fixed memory corruption when parsing repo files
diff --git a/src/gfpm-repomanager.c b/src/gfpm-repomanager.c
index 0cd5350..8e27020 100644
--- a/src/gfpm-repomanager.c
+++ b/src/gfpm-repomanager.c
@@ -158,7 +158,8 @@ gfpm_repomgr_get_servers_from_repofile (const char
*conf_file)
continue;
if (line[0] == '#')
{
- entry->comments = g_list_append (entry->comments, line);
+ entry->comments = g_list_append (entry->comments,
g_strdup(line));
+ //g_print ("COMMENT: %s\n", entry->comments);
continue;
}
if (sscanf(line, "Server = %s", server))
@@ -491,10 +492,10 @@ gfpm_write_servers_to_file (const gchar *reponame)
while (comment != NULL)
{
printf ("COMMENT : %s\n", comment->data);
- fprintf (fp, "%s", (char*)comment->data);
+ fprintf (fp, "%s\n", (char*)comment->data);
comment = g_list_next (comment);
}
- fprintf (fp, "Server = %s", s->url);
+ fprintf (fp, "Server = %s\n", s->url);
slist = g_list_next (slist);
}
fclose (fp);
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git