[glib] gsocket: test if family is <= 0, not < 0
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] gsocket: test if family is <= 0, not < 0
- Date: Wed, 25 Apr 2012 14:49:58 +0000 (UTC)
commit 87cc77a1985efa18bcd8fc3318c90d8557ae9129
Author: Dan Winship <danw gnome org>
Date: Wed Apr 25 10:44:55 2012 -0400
gsocket: test if family is <= 0, not < 0
If all members of GSocketFamily are supported on the platform, then
all of its values will be positive, and so the enum might become
unsigned, in which case testing for "family < 0" might cause warnings.
But we want to return an error if family == 0 (aka
G_SOCKET_FAMILY_INVALID) anyway, so just tweak the test accordingly.
https://bugzilla.gnome.org/show_bug.cgi?id=674592
gio/gsocket.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gio/gsocket.c b/gio/gsocket.c
index b24000f..0b8d91b 100644
--- a/gio/gsocket.c
+++ b/gio/gsocket.c
@@ -500,7 +500,7 @@ g_socket_create_socket (GSocketFamily family,
g_assert_not_reached ();
}
- if (family < 0)
+ if (family <= 0)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
_("Unable to create socket: %s"), _("Unknown family was specified"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]