summaryrefslogtreecommitdiff
path: root/src/message.c
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-09-28 13:33:38 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-09-28 13:33:38 +0200
commitc7af5a0a0fabbd70ecadafb75cf7d8c0a9b9a9ed (patch)
tree1e043218985113a3c2d647f0a652d052dca443e6 /src/message.c
parent4b786cf0be8e968542f0b4b783cf2b8ebb44789a (diff)
downloadcmumble-c7af5a0a0fabbd70ecadafb75cf7d8c0a9b9a9ed.tar.gz
cmumble-c7af5a0a0fabbd70ecadafb75cf7d8c0a9b9a9ed.tar.bz2
cmumble-c7af5a0a0fabbd70ecadafb75cf7d8c0a9b9a9ed.zip
message: Fix segfault when error is Null but ret <= 0
Diffstat (limited to 'src/message.c')
-rw-r--r--src/message.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/message.c b/src/message.c
index c29b8d8..a7da5da 100644
--- a/src/message.c
+++ b/src/message.c
@@ -97,7 +97,9 @@ cmumble_recv_msg(struct cmumble_context *ctx)
return 0;
}
- g_printerr("read failed: %ld: %d %s\n", ret, error->code, error->message);
+ g_printerr("read failed: %ld: %d %s\n", ret,
+ error ? error->code : -1,
+ error ? error->message: "unknown");
return 0;
}