From 56de1b21a003db58617aab14bd2d6591b62eac0d Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 6 Sep 2013 13:14:29 +0100 Subject: [PATCH 02/19] tube offering examples: don't dump core on invalid arguments Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54061 --- examples/client/dbus-tubes/offerer.c | 5 ++++- examples/client/stream-tubes/offerer.c | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/client/dbus-tubes/offerer.c b/examples/client/dbus-tubes/offerer.c index 9ff053f..70d9103 100644 --- a/examples/client/dbus-tubes/offerer.c +++ b/examples/client/dbus-tubes/offerer.c @@ -191,7 +191,10 @@ main (int argc, g_type_init (); if (argc != 3) - g_error ("Usage: offerer gabble/jabber/ladygaga t-pain@example.com"); + { + g_printerr ("Usage: offerer gabble/jabber/ladygaga t-pain@example.com\n"); + return 2; + } factory = TP_SIMPLE_CLIENT_FACTORY (tp_automatic_client_factory_new (NULL)); diff --git a/examples/client/stream-tubes/offerer.c b/examples/client/stream-tubes/offerer.c index 85e14a7..d6361b0 100644 --- a/examples/client/stream-tubes/offerer.c +++ b/examples/client/stream-tubes/offerer.c @@ -140,7 +140,11 @@ main (int argc, TpAccountChannelRequest *req; GHashTable *request; - g_assert (argc == 3); + if (argc != 3) + { + g_printerr ("Usage: offerer gabble/jabber/ladygaga t-pain@example.com\n"); + return 2; + } g_type_init (); -- 1.8.4.rc3