* Fixes NB#89889, if the size is < 1Kb then show it as 1Kb
[modest] / src / modest-protocol-registry.c
index dae386f..42ffcd6 100644 (file)
@@ -80,7 +80,7 @@ static void   modest_protocol_registry_instance_init (ModestProtocolRegistry *ob
 static GHashTable *   modest_protocol_registry_create_tag (ModestProtocolRegistry *obj, const gchar *tag);
 
 /* translation handlers */
-static gchar * translation_is_userdata (gpointer userdata, ...);
+static gchar * translation_is_userdata (gpointer userdata, va_list args);
 
 typedef struct _ModestProtocolRegistryPrivate ModestProtocolRegistryPrivate;
 struct _ModestProtocolRegistryPrivate {
@@ -322,12 +322,17 @@ find_protocol_by_name (ModestProtocolType type_id,
 }
 
 ModestProtocol *
-modest_protocol_registry_get_protocol_by_name (ModestProtocolRegistry *self, const gchar *tag, const gchar *name)
+modest_protocol_registry_get_protocol_by_name (ModestProtocolRegistry *self, 
+                                              const gchar *tag, 
+                                              const gchar *name)
 {
        ModestProtocolRegistryPrivate *priv;
        GHashTable *tag_table;
 
        g_return_val_if_fail (MODEST_IS_PROTOCOL_REGISTRY (self), NULL);
+       g_return_val_if_fail (tag, NULL);
+       g_return_val_if_fail (name, NULL);
+
        priv = MODEST_PROTOCOL_REGISTRY_GET_PRIVATE (self);
 
        tag_table = g_hash_table_lookup (priv->tags_table, tag);
@@ -390,21 +395,20 @@ modest_protocol_registry_create_tag (ModestProtocolRegistry *self, const gchar *
 }
 
 static gchar * 
-translation_is_userdata (gpointer userdata, ...)
+translation_is_userdata (gpointer userdata, va_list args)
 {
-       va_list args, dest;
+       va_list dest;
        gchar *result;
 
-       va_start(args, userdata);
-       va_copy (dest, args);
-       result = g_strdup_printf (_(userdata), dest);
-       va_end (args);
+       G_VA_COPY (dest, args);
+       result = g_strdup_vprintf (_(userdata), dest);
+       va_end (dest);
 
        return result;
 }
 
 static gchar * 
-translation_is_userdata_no_param (gpointer userdata, ...)
+translation_is_userdata_no_param (gpointer userdata, va_list args)
 {
        gchar *result;