libopkg: fix printing provides in pkg_formatted_field()
authorJo-Philipp Wich <jo@mein.io>
Thu, 16 Feb 2017 11:10:16 +0000 (12:10 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 16 Feb 2017 16:02:30 +0000 (17:02 +0100)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
libopkg/pkg.c

index 3633a3c..023cf75 100644 (file)
@@ -796,10 +796,9 @@ void pkg_formatted_field(FILE * fp, pkg_t * pkg, const char *field)
                        ab_pkg = pkg_get_ptr(pkg, PKG_PROVIDES);
                        if (ab_pkg && ab_pkg[0] && ab_pkg[1]) {
                                fprintf(fp, "Provides:");
-                               for (i = 0, ab_pkg++; *ab_pkg; i++, ab_pkg++) {
-                                       fprintf(fp, "%s %s", i == 0 ? "" : ",",
-                                               (*ab_pkg)->name);
-                                       ab_pkg++;
+                               for (i = 1; ab_pkg[i]; i++) {
+                                       fprintf(fp, "%s %s", i == 1 ? "" : ",",
+                                               ab_pkg[i]->name);
                                }
                                fprintf(fp, "\n");
                        }