Diffstat (limited to 'noncore/net/wellenreiter/libwellenreiter/source/proto.cc') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/libwellenreiter/source/proto.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/proto.cc b/noncore/net/wellenreiter/libwellenreiter/source/proto.cc index 359bdb5..305f401 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/proto.cc +++ b/noncore/net/wellenreiter/libwellenreiter/source/proto.cc @@ -1,27 +1,27 @@ /* - * Communication protocol + * Communication protocol * * $Id$ */ #include "proto.hh" #include "sock.hh" /* Send found network to GUI */ int send_network_found (const char *guihost, int guiport, void *structure) { wl_network_t *ptr; char buffer[2048]; - char temp[4]; + char temp[5]; ptr = (wl_network_t *)structure; memset(buffer, 0, 2048); /* Type = Found new net */ memcpy(buffer, "01", 2); /* Set Net-type */ memset(temp, 0, sizeof(temp)); snprintf(temp, 2, "%d", ptr->net_type); memcpy(buffer + 2, temp, 1); @@ -47,27 +47,32 @@ int send_network_found (const char *guihost, int guiport, void *structure) /* Set lenght of ssid */ memset(temp, 0, sizeof(temp)); if(ptr->ssid_len > 99) snprintf(temp, 4, "%d", ptr->ssid_len); else if(ptr->ssid_len < 10) snprintf(temp, 4, "00%d", ptr->ssid_len); else snprintf(temp, 4, "0%d", ptr->ssid_len); memcpy(buffer + 23, temp, 3); + fprintf( stderr, "Temp is %s\n", temp ); + fprintf( stderr, "ssid_len is %d\n", ptr->ssid_len ); + /* Set ssid */ memcpy(buffer + 26, ptr->bssid, ptr->ssid_len); + fprintf( stderr, "Buffer is %s\n", buffer ); + /* Send prepared buffer to GUI */ sendcomm(guihost, guiport, buffer); return 1; } /* Fill buffer into structur */ int get_network_found (void *structure, const char *buffer) { wl_network_t *ptr; char temp[512]; |