From 5e3f7402206e269e013c050a5a0e98a579a0246e Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Fri, 19 Dec 2008 11:25:14 +0000 Subject: improved the error reporting of the network unpacker --- datasrc/compile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'datasrc/compile.py') diff --git a/datasrc/compile.py b/datasrc/compile.py index 6258b905..179020fd 100644 --- a/datasrc/compile.py +++ b/datasrc/compile.py @@ -217,9 +217,9 @@ if gen_network_source: lines += ['{'] lines += ['\tvoid *msg;'] lines += ['\tmsg_failed_on = "";'] - lines += ['\tif(type < 0 || type >= NUM_NETMSGTYPES) return 0;'] + lines += ['\tif(type < 0 || type >= NUM_NETMSGTYPES) { msg_failed_on = "(type out of range)"; return 0; }'] lines += ['\tmsg = secure_unpack_funcs[type]();'] - lines += ['\tif(msg_unpack_error()) return 0;'] + lines += ['\tif(msg_unpack_error()) { msg_failed_on = "(unpack error)"; return 0; }'] lines += ['\treturn msg;'] lines += ['};'] lines += [''] -- cgit 1.4.1