gnome-panel r11082 - branches/gnome-2-22/applets/clock



Author: matthiasc
Date: Wed Apr 23 13:12:31 2008
New Revision: 11082
URL: http://svn.gnome.org/viewvc/gnome-panel?rev=11082&view=rev

Log:
2008-04-23  Matthias Clasen  <mclasen redhat com>

        * system-timezone.c (system_timezone_is_valid): Don't assume
        that g_io_channel_read_chars returns a NUL-terminated string -
        it doesn't.



Modified:
   branches/gnome-2-22/applets/clock/ChangeLog
   branches/gnome-2-22/applets/clock/system-timezone.c

Modified: branches/gnome-2-22/applets/clock/system-timezone.c
==============================================================================
--- branches/gnome-2-22/applets/clock/system-timezone.c	(original)
+++ branches/gnome-2-22/applets/clock/system-timezone.c	Wed Apr 23 13:12:31 2008
@@ -910,7 +910,7 @@
                 return FALSE;
         }
 
-        if (read != 4 || strcmp (buffer, TZ_MAGIC) != 0) {
+        if (read != strlen (TZ_MAGIC) || strncmp (buffer, TZ_MAGIC, strlen (TZ_MAGIC)) != 0) {
                 g_set_error (error, SYSTEM_TIMEZONE_ERROR,
                              SYSTEM_TIMEZONE_ERROR_INVALID_TIMEZONE_FILE,
                              "%s is not a timezone file",



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