added manpage
[ppastats.git] / src / ppastats.c
index 3a4b0ef..1fa0e81 100644 (file)
@@ -100,7 +100,6 @@ static struct distro_stats *get_distro_stats(struct version_stats *version,
        d->name = strdup(name);
        d->archs = NULL;
        d->download_count = 0;
-       d->daily_download_totals = NULL;
 
        version->distros
                = (struct distro_stats **)list_add((void **)version->distros,
@@ -126,7 +125,6 @@ static struct arch_stats *get_arch_stats(struct distro_stats *distro,
 
        a = malloc(sizeof(struct arch_stats));
        a->name = strdup(name);
-       a->daily_download_totals = NULL;
        a->download_count = 0;
 
        distro->archs
@@ -255,6 +253,10 @@ create_ppa_stats(const char *owner,
                        = add_totals(package->daily_download_totals,
                                     totals);
 
+               version->daily_download_totals
+                       = add_totals(version->daily_download_totals,
+                                    totals);
+
                daily_download_total_list_free(totals);
 
                h_cur++;