[gnome-software] Fix an off-by-one error



commit c7c245c6a2c48bd2b9969b93f7010069cba9f0af
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Sep 5 23:32:28 2013 -0400

    Fix an off-by-one error
    
    When using G_N_ELEMENTS, we can't use a NULL-terminated array.
    G_N_ELEMENTS counts the NULL too.

 src/plugins/gs-plugin-hardcoded-featured.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/src/plugins/gs-plugin-hardcoded-featured.c b/src/plugins/gs-plugin-hardcoded-featured.c
index 0de1f7e..9df3b8a 100644
--- a/src/plugins/gs-plugin-hardcoded-featured.c
+++ b/src/plugins/gs-plugin-hardcoded-featured.c
@@ -60,7 +60,6 @@ gs_plugin_add_featured (GsPlugin *plugin,
                 "gimp",
                 "org.gnome.Weather.Application",
                 "gnome-sudoku",
-               NULL
         };
 
         /* In lieu of a random number generator, just
@@ -74,8 +73,7 @@ gs_plugin_add_featured (GsPlugin *plugin,
 
         app = gs_app_new (apps[i]);
        gs_plugin_add_app (list, app);
-       path = g_strdup_printf ("%s/gnome-software/featured-%s.png",
-                               DATADIR, apps[i]);
+       path = g_strconcat (DATADIR, "/gnome-software/featured-", apps[i], ".png", NULL);
        pixbuf = gdk_pixbuf_new_from_file_at_scale (path, -1, -1, TRUE, error);
        g_free (path);
        if (pixbuf == NULL) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]