1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-15 09:25:37 +02:00

Make sure relevant std::stringstreams are set to binary

This commit is contained in:
sfan5
2021-09-11 21:06:57 +02:00
committed by GitHub
parent 766e885a1b
commit 75bf9b75ca
17 changed files with 54 additions and 66 deletions

View File

@@ -127,8 +127,7 @@ void Database_Redis::loadBlock(const v3s16 &pos, std::string *block)
switch (reply->type) {
case REDIS_REPLY_STRING: {
*block = std::string(reply->str, reply->len);
// std::string copies the memory so this won't cause any problems
block->assign(reply->str, reply->len);
freeReplyObject(reply);
return;
}
@@ -141,8 +140,7 @@ void Database_Redis::loadBlock(const v3s16 &pos, std::string *block)
"Redis command 'HGET %s %s' errored: ") + errstr);
}
case REDIS_REPLY_NIL: {
*block = "";
// block not found in database
block->clear();
freeReplyObject(reply);
return;
}