summaryrefslogtreecommitdiff
path: root/gtk/gtkprinter.c
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2010-01-08 17:42:34 +0100
committerJavier Jardón <jjardon@gnome.org>2010-01-08 18:27:43 +0100
commitf5b21802bbf02d89c61633286492f62109b0f2a2 (patch)
tree45912a40935c9bb2db73bb4ce9d7f5b21f56fa14 /gtk/gtkprinter.c
parentfbd0db99e44aadfd038c32ee5a32e0943115a490 (diff)
downloadgtk+-f5b21802bbf02d89c61633286492f62109b0f2a2.tar.gz
Use g_strcmp0() instead custom safe_strcmp()
Reported by Rafal Luzynski in https://bugzilla.gnome.org/show_bug.cgi?id=606415
Diffstat (limited to 'gtk/gtkprinter.c')
-rw-r--r--gtk/gtkprinter.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/gtk/gtkprinter.c b/gtk/gtkprinter.c
index 9ef7dc892d..1ffaaf5bcb 100644
--- a/gtk/gtkprinter.c
+++ b/gtk/gtkprinter.c
@@ -92,18 +92,6 @@ static void gtk_printer_get_property (GObject *object,
G_DEFINE_TYPE (GtkPrinter, gtk_printer, G_TYPE_OBJECT)
-static int
-safe_strcmp (const char *a, const char *b)
-{
- if (a == b)
- return 0;
- if (a == NULL)
- return -1;
- if (b == NULL)
- return 1;
- return strcmp (a, b);
-}
-
static void
gtk_printer_class_init (GtkPrinterClass *class)
{
@@ -468,7 +456,7 @@ gtk_printer_set_description (GtkPrinter *printer,
priv = printer->priv;
- if (safe_strcmp (priv->description, description) == 0)
+ if (g_strcmp0 (priv->description, description) == 0)
return FALSE;
g_free (priv->description);
@@ -506,7 +494,7 @@ gtk_printer_set_state_message (GtkPrinter *printer,
priv = printer->priv;
- if (safe_strcmp (priv->state_message, message) == 0)
+ if (g_strcmp0 (priv->state_message, message) == 0)
return FALSE;
g_free (priv->state_message);
@@ -544,7 +532,7 @@ gtk_printer_set_location (GtkPrinter *printer,
priv = printer->priv;
- if (safe_strcmp (priv->location, location) == 0)
+ if (g_strcmp0 (priv->location, location) == 0)
return FALSE;
g_free (priv->location);