changeset 20817:38d7c849d444

datallah pointed out that using g_return_if_fail() is preferable to g_assert()ing.
author Will Thompson <will.thompson@collabora.co.uk>
date Tue, 09 Oct 2007 15:03:48 +0000
parents efa448405f3d
children c560286daede
files libpurple/connection.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/connection.c	Tue Oct 09 13:42:15 2007 +0000
+++ b/libpurple/connection.c	Tue Oct 09 15:03:48 2007 +0000
@@ -502,7 +502,7 @@
 	PurpleConnectionUiOps *ops;
 
 	g_return_if_fail(gc   != NULL);
-	g_assert (reason < PURPLE_NUM_REASONS);
+	g_return_if_fail(reason < PURPLE_NUM_REASONS);
 
 	if (description == NULL) {
 		purple_debug_error("connection", "purple_connection_error_reason: check `description != NULL' failed\n");
@@ -575,6 +575,8 @@
 		case PURPLE_REASON_INVALID_SETTINGS:
 		case PURPLE_REASON_OTHER_ERROR:
 			return TRUE;
+		default:
+			g_return_val_if_reached(TRUE);
 	}
 }