diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-08-14 18:37:16 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-08-14 18:37:16 +0000 |
| commit | 2cde04ddcec3f3c083527c464f93bf8c30b6e790 (patch) | |
| tree | 2666b20bf713f7d5244af1aec9f2d2f54d193f35 /src/engine/packet.h | |
| parent | 8809084d253be4e9923307a13c8830c593dfefc0 (diff) | |
| download | zcatch-2cde04ddcec3f3c083527c464f93bf8c30b6e790.tar.gz zcatch-2cde04ddcec3f3c083527c464f93bf8c30b6e790.zip | |
merged over all stuff from 0.2 to trunk
Diffstat (limited to 'src/engine/packet.h')
| -rw-r--r-- | src/engine/packet.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/engine/packet.h b/src/engine/packet.h index 79c969c2..1dd3c3ab 100644 --- a/src/engine/packet.h +++ b/src/engine/packet.h @@ -1,4 +1,5 @@ #include <stdarg.h> +#include <string.h> #include <baselib/stream/file.h> #include <baselib/network.h> @@ -273,6 +274,9 @@ public: int get_int() { + if(current >= end) + return 0; + int i; current = vint_unpack(current, &i); // TODO: might be changed into variable width @@ -285,6 +289,9 @@ public: const char *get_string() { + if(current >= end) + return ""; + // TODO: add range check // TODO: add debug marker const char *ptr = (const char *)current; |