+static struct daily_download_total *ddt_clone(struct daily_download_total *ddt)
+{
+ struct daily_download_total *new;
+
+ new = malloc(sizeof(struct daily_download_total));
+
+ new->date = ddt->date;
+ new->count = ddt->count;
+
+ return new;
+}
+
+static struct daily_download_total **
+ddts_clone(struct daily_download_total **ddts)
+{
+ int n, i;
+ struct daily_download_total **new;
+
+ n = ddts_length(ddts);
+
+ new = malloc((n + 1) * sizeof(struct daily_download_total *));
+
+ for (i = 0; i < n; i++)
+ new[i] = ddt_clone(ddts[i]);