summaryrefslogtreecommitdiff
path: root/src/pairing.cpp
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2022-06-25 22:17:59 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2022-06-25 22:17:59 +0200
commit92bc3e9a534f2960d584b5e6698c7122a9ee2f87 (patch)
tree09b9295232a6f9c021fe72063cb19cc3c3d63aea /src/pairing.cpp
parent5e63d0a516de660ed215b0f8ebe8d3e5d697f19e (diff)
Test: guard attach code match
Diffstat (limited to 'src/pairing.cpp')
-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;
}