mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Correctly initialize string in core/device.cpp
When initializing a string with multiple characters, first comes the length, then the size. Not the other way around. Fixes #4127. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
8b5812bc2c
commit
c7a929a8a8
1 changed files with 1 additions and 1 deletions
|
@ -296,7 +296,7 @@ std::string fp_get_data(struct fingerprint_table *table, unsigned int i)
|
||||||
if (!table || i >= table->fingerprints.size())
|
if (!table || i >= table->fingerprints.size())
|
||||||
return std::string();
|
return std::string();
|
||||||
struct fingerprint_record *fpr = &table->fingerprints[i];
|
struct fingerprint_record *fpr = &table->fingerprints[i];
|
||||||
std::string res(' ', fpr->fsize * 2);
|
std::string res(fpr->fsize * 2, ' ');
|
||||||
for (unsigned int i = 0; i < fpr->fsize; ++i) {
|
for (unsigned int i = 0; i < fpr->fsize; ++i) {
|
||||||
res[2 * i] = to_hex_digit((fpr->raw_data[i] >> 4) & 0xf);
|
res[2 * i] = to_hex_digit((fpr->raw_data[i] >> 4) & 0xf);
|
||||||
res[2 * i + 1] = to_hex_digit(fpr->raw_data[i] & 0xf);
|
res[2 * i + 1] = to_hex_digit(fpr->raw_data[i] & 0xf);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue