summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pairing.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pairing.cpp b/src/pairing.cpp
index e1e04cc..91e0b0f 100644
--- a/src/pairing.cpp
+++ b/src/pairing.cpp
@@ -204,8 +204,8 @@ string PairingServiceBase::confirmationNumber(const vector<uint8_t> & digest)
{
uint32_t confirm;
memcpy(&confirm, digest.data(), sizeof(confirm));
- string ret(7, '\0');
- snprintf(ret.data(), ret.size(), "%06d", ntohl(confirm) % 1000000);
+ string ret(6, '\0');
+ snprintf(ret.data(), ret.size() + 1, "%06d", ntohl(confirm) % 1000000);
return ret;
}