1 --- a/archival/libipkg/pkg.c
2 +++ b/archival/libipkg/pkg.c
8 + len = sizeof("Conffiles:") ;
9 for (iter = pkg->conffiles.head; iter; iter = iter->next) {
10 if (iter->data->name && iter->data->value) {
11 - len = len + (strlen(iter->data->name)+strlen(iter->data->value)+5);
13 + /* " <filename> <md5hash>" */
14 + len += 1+strlen(iter->data->name)+1+strlen(iter->data->value);
17 + len +=2; /* "\n\0" */
18 temp = (char *)realloc(temp,len);
20 fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
24 - strncpy(temp, "Conffiles:\n", 12);
25 + strcpy(temp, "Conffiles:");
26 for (iter = pkg->conffiles.head; iter; iter = iter->next) {
27 if (iter->data->name && iter->data->value) {
28 - snprintf(line_str, LINE_LEN, "%s %s\n", iter->data->name, iter->data->value);
29 + snprintf(line_str, LINE_LEN, " %s %s", iter->data->name, iter->data->value);
30 strncat(temp, line_str, strlen(line_str));
34 } else if (strcasecmp(field, "Conflicts") == 0) {
37 --- a/archival/libipkg/pkg_parse.c
38 +++ b/archival/libipkg/pkg_parse.c
40 if(!strncmp(raw, "Conffiles:", 10))
41 raw += strlen("Conffiles:");
43 + while(*raw && isspace(*raw)) raw++;
44 while(*raw && (sscanf(raw, "%s%s", file_name, md5sum) == 2)){
45 conffile_list_append(&pkg->conffiles, file_name, md5sum);
46 /* fprintf(stderr, "%s %s ", file_name, md5sum);*/
47 - while (*raw && isspace(*raw)) {
50 raw += strlen(file_name);
51 - while (*raw && isspace(*raw)) {
54 + while(*raw && isspace(*raw)) raw++;
55 raw += strlen(md5sum);
56 + while(*raw && isspace(*raw)) raw++;