gnome-session r5193 - in trunk: . gnome-session



Author: mccann
Date: Mon Jan 12 00:07:43 2009
New Revision: 5193
URL: http://svn.gnome.org/viewvc/gnome-session?rev=5193&view=rev

Log:
2009-01-11  William Jon McCann  <jmccann redhat com>

	* gnome-session/gsm-presence.c (gsm_presence_set_status_text):
	Add status text size limit.



Modified:
   trunk/ChangeLog
   trunk/gnome-session/gsm-presence.c

Modified: trunk/gnome-session/gsm-presence.c
==============================================================================
--- trunk/gnome-session/gsm-presence.c	(original)
+++ trunk/gnome-session/gsm-presence.c	Mon Jan 12 00:07:43 2009
@@ -35,6 +35,8 @@
 
 #define GSM_PRESENCE_DBUS_PATH "/org/gnome/SessionManager/Presence"
 
+#define MAX_STATUS_TEXT 140
+
 #define IS_STRING_EMPTY(x) ((x)==NULL||(x)[0]=='\0')
 
 #define GSM_PRESENCE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSM_TYPE_PRESENCE, GsmPresencePrivate))
@@ -240,7 +242,11 @@
 
         /* check length */
         if (status_text != NULL && strlen (status_text) > MAX_STATUS_TEXT) {
-
+                g_set_error (error,
+                             GSM_PRESENCE_ERROR,
+                             GSM_PRESENCE_ERROR_GENERAL,
+                             "Status text too long");
+                return FALSE;
         }
 
         if (status_text != NULL) {



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