-rw-r--r-- | noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc b/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc index dcdc16b..6c3846f 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc +++ b/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc @@ -93,65 +93,65 @@ int send_fail(const char *guihost, int guiport, /* Send prepared buffer to UI */ #ifdef DEBUG wl_loginfo("Send CMD_FAIL to UI: '%s'", buffer); #endif return ((!wl_send(guihost, guiport, buffer)) ? 0 : 1); } int get_ok(const char *buffer) { char temp[5]; unsigned int len = 0; /* packet type already determined, skip check */ len += 2; /* what is ok for? */ memset(temp, 0, sizeof(temp)); len += get_field(buffer + len, temp, sizeof(temp)); return atoi(temp); } /* put failmessage into buffer */ -int get_fail(char *out, const char *buffer, size_t len) +int get_fail(char *out, const char *buffer, size_t bufflen) { char temp[5]; int error=0; unsigned int len = 0; /* packet type already determined, skip check */ len += 2; /* what is fail for? */ memset(temp, 0, sizeof(temp)); len += get_field(buffer + len, temp, sizeof(temp)); error=atoi(temp); /* get errorstring and fill into buffer */ - memset(out, 0, len); - len += get_field(buffer + len, out, len - 1); + memset(out, 0, bufflen); + len += get_field(buffer + len, out, bufflen - 1); return error; } /* Send found network to UI */ int send_network_found (const char *guihost, int guiport, void *structure) { wl_network_t *ptr; char buffer[2048], temp[5]; unsigned int len = 0; ptr = (wl_network_t *)structure; memset(buffer,0,sizeof(buffer)); /* Type = Found new net (without length field) */ memset(temp, 0, sizeof(temp)); snprintf(temp, sizeof(temp) - 1, "%.2d", WL_NETFOUND); memcpy(buffer, temp, 2); len += 2; /* Set Net-type */ memset(temp, 0, sizeof(temp)); snprintf(temp, sizeof(temp) - 1, "%d", ptr->net_type); |