Diffstat (limited to 'noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc b/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc index 0630d04..664ba92 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc +++ b/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc | |||
@@ -4,6 +4,7 @@ | |||
4 | * $Id$ | 4 | * $Id$ |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include "wl_types.hh" | ||
7 | #include "wl_proto.hh" | 8 | #include "wl_proto.hh" |
8 | #include "wl_log.hh" | 9 | #include "wl_log.hh" |
9 | #include "wl_sock.hh" | 10 | #include "wl_sock.hh" |
@@ -34,7 +35,7 @@ int get_field(const char *buffer, char *out, int maxlen) | |||
34 | /* Copy buffer to out pointer */ | 35 | /* Copy buffer to out pointer */ |
35 | memset(out, 0, maxlen); | 36 | memset(out, 0, maxlen); |
36 | 37 | ||
37 | if(atoi(len)-3 > maxlen -1) | 38 | if(atoi(len) > maxlen -1) |
38 | memcpy(out, buffer + 3, maxlen - 1); | 39 | memcpy(out, buffer + 3, maxlen - 1); |
39 | else | 40 | else |
40 | memcpy(out, buffer + 3, atoi(len)); | 41 | memcpy(out, buffer + 3, atoi(len)); |
@@ -54,7 +55,7 @@ int send_network_found (const char *guihost, int guiport, void *structure) | |||
54 | 55 | ||
55 | /* Type = Found new net (without length field) */ | 56 | /* Type = Found new net (without length field) */ |
56 | memset(temp, 0, sizeof(temp)); | 57 | memset(temp, 0, sizeof(temp)); |
57 | snprintf(temp, sizeof(temp), "%.2d", NETFOUND); | 58 | snprintf(temp, sizeof(temp), "%.2d", WL_NETFOUND); |
58 | memcpy(buffer, temp, 2); | 59 | memcpy(buffer, temp, 2); |
59 | len += 2; | 60 | len += 2; |
60 | 61 | ||
@@ -98,7 +99,7 @@ int get_network_found (void *structure, const char *buffer) | |||
98 | unsigned int len = 0; | 99 | unsigned int len = 0; |
99 | 100 | ||
100 | ptr = (wl_network_t *)structure; | 101 | ptr = (wl_network_t *)structure; |
101 | 102 | ||
102 | /* packet type already determined, skip check */ | 103 | /* packet type already determined, skip check */ |
103 | len += 2; | 104 | len += 2; |
104 | 105 | ||