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 | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc b/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc index f15523f..5317f52 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc +++ b/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc | |||
@@ -35,10 +35,11 @@ int get_field(const char *buffer, char *out) | |||
35 | memset(out, 0, atoi(len) + 1); | 35 | memset(out, 0, atoi(len) + 1); |
36 | memcpy(out, buffer + 3, atoi(len)); | 36 | memcpy(out, buffer + 3, atoi(len)); |
37 | 37 | ||
38 | return atoi(len) + 3; | 38 | /* Return length of whole field (including 3 byte length) */ |
39 | return (atoi(len) + 3); | ||
39 | } | 40 | } |
40 | 41 | ||
41 | /* Send found network to GUI */ | 42 | /* Send found network to UI */ |
42 | int send_network_found (const char *guihost, int guiport, void *structure) | 43 | int send_network_found (const char *guihost, int guiport, void *structure) |
43 | { | 44 | { |
44 | wl_network_t *ptr; | 45 | wl_network_t *ptr; |
@@ -75,20 +76,18 @@ int send_network_found (const char *guihost, int guiport, void *structure) | |||
75 | len += retval; | 76 | len += retval; |
76 | 77 | ||
77 | /* Set Mac */ | 78 | /* Set Mac */ |
78 | retval = add_field(buffer + len, (char *)ptr->mac, 17); | 79 | retval = add_field(buffer + len, ptr->mac, 17); |
79 | len += retval; | 80 | len += retval; |
80 | 81 | ||
81 | /* Set ssid */ | 82 | /* Set ssid */ |
82 | retval = add_field(buffer + len, (char *)ptr->bssid, ptr->ssid_len); | 83 | retval = add_field(buffer + len, ptr->bssid, ptr->ssid_len); |
83 | 84 | ||
84 | /* Send prepared buffer to GUI */ | 85 | /* Send prepared buffer to UI */ |
85 | #ifdef DEBUG | 86 | #ifdef DEBUG |
86 | wl_loginfo("Sending network to GUI: '%s'", buffer); | 87 | wl_loginfo("Sending network to UI: '%s'", buffer); |
87 | #endif | 88 | #endif |
88 | 89 | ||
89 | wl_send(guihost, guiport, buffer); | 90 | return ((!wl_send(guihost, guiport, buffer)) ? 0 : 1); |
90 | |||
91 | return 1; | ||
92 | } | 91 | } |
93 | 92 | ||
94 | /* Fill buffer into structur */ | 93 | /* Fill buffer into structur */ |