Showing the changes to interface/src/DataServerClient.cpp (1 of 2 files). Show all
Unified · Split
| @@ -78,8 +78,12 @@ void DataServerClient::getValueForKeyAndUserString(const char* key, QString& use · 77 unmodified lines | |||
| 78 | 78 | ||
| 79 | // pack the key, null terminated | 79 | // pack the key, null terminated |
| 80 | strcpy((char*) getPacket + numPacketBytes, key); | 80 | strcpy((char*) getPacket + numPacketBytes, key); |
| 81 | numPacketBytes += strlen(key); | 81 | int numKeyBytes = strlen(key); |
| 82 | getPacket[numPacketBytes++] = '\0'; | 82 | |
| 83 | if (numKeyBytes > 0) { | ||
| 84 | numPacketBytes += numKeyBytes; | ||
| 85 | getPacket[numPacketBytes++] = '\0'; | ||
| 86 | } | ||
| 83 | 87 | ||
| 84 | // add the getPacket to our vector of uncofirmed packets, will be deleted once we get a response from the nameserver | 88 | // add the getPacket to our vector of uncofirmed packets, will be deleted once we get a response from the nameserver |
| 85 | _unmatchedPackets.insert(std::pair<unsigned char*, int>(getPacket, numPacketBytes)); | 89 | _unmatchedPackets.insert(std::pair<unsigned char*, int>(getPacket, numPacketBytes)); |