[Xfce4-commits] [xfce/xfce4-power-manager] 01/01: Don't hard-code gulong parameter

noreply at xfce.org noreply at xfce.org
Sat Feb 7 17:30:03 CET 2015


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository xfce/xfce4-power-manager.

commit 07d0b6495bbdb5f8135146699662e39ff21004d2
Author: Olivier Duchateau <duchateau.olivier at gmail.com>
Date:   Sat Feb 7 19:20:26 2015 +0300

    Don't hard-code gulong parameter
    
    Signed-off-by: Eric Koegel <eric.koegel at gmail.com>
---
 src/xfpm-backlight-helper.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/xfpm-backlight-helper.c b/src/xfpm-backlight-helper.c
index 4584edc..13e8521 100644
--- a/src/xfpm-backlight-helper.c
+++ b/src/xfpm-backlight-helper.c
@@ -201,15 +201,15 @@ backlight_helper_set_brightness (gchar *device, gint value)
 static gchar *
 backlight_helper_get_device (void)
 {
-	/* 'tv' device is also available */
-	gchar *types[] = { "lcd", "crt", "out", "ext", NULL };
+	/* devices in priority order */
+	gchar *types[] = { "lcd", "crt", "out", "ext", "tv", NULL };
 	gchar *device = NULL;
 	gint i;
 
 	device = (gchar *) g_malloc (sizeof (gchar));
 
 	for (i = 0; types[i] != NULL; i++) {
-		g_snprintf (device, 5, "%s0", types[i]);
+		g_snprintf (device, (gulong) strlen (types[i]), "%s0", types[i]);
 
 		/* stop, when first device is found */
 		if (acpi_video_is_enabled (device))

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list