X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjournal%2Fcatalog.c;h=90ca00806448b3282df1f6bddf63554524255fc6;hb=916484f54d084e11a11458716b2e0bbdf4822d40;hp=ebf0622609434fba90fc77f43539ae281635eccc;hpb=844ec79b3c2f246114ea316ebe1f36044bdb688e;p=elogind.git diff --git a/src/journal/catalog.c b/src/journal/catalog.c index ebf062260..90ca00806 100644 --- a/src/journal/catalog.c +++ b/src/journal/catalog.c @@ -180,7 +180,7 @@ int catalog_import_file(Hashmap *h, struct strbuf *sb, const char *path) { continue; } - if (strchr(COMMENTS, line[0])) + if (strchr(COMMENTS "\n", line[0])) continue; if (empty_line && @@ -277,7 +277,7 @@ static long write_catalog(const char *database, Hashmap *h, struct strbuf *sb, CatalogHeader header; _cleanup_fclose_ FILE *w = NULL; int r; - char _cleanup_free_ *d, *p = NULL; + _cleanup_free_ char *d, *p = NULL; size_t k; d = dirname_malloc(database); @@ -399,7 +399,7 @@ int catalog_update(const char* database, const char* root, const char* const* di } assert(n == hashmap_size(h)); - qsort(items, n, sizeof(CatalogItem), catalog_compare_func); + qsort_safe(items, n, sizeof(CatalogItem), catalog_compare_func); r = write_catalog(database, h, sb, items, n); if (r < 0) @@ -627,7 +627,7 @@ int catalog_list_items(FILE *f, const char *database, bool oneline, char **items STRV_FOREACH(item, items) { sd_id128_t id; int k; - char _cleanup_free_ *msg = NULL; + _cleanup_free_ char *msg = NULL; k = sd_id128_from_string(*item, &id); if (k < 0) {