mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Make sure relevant std::stringstreams are set to binary
This commit is contained in:
parent
766e885a1b
commit
75bf9b75ca
17 changed files with 54 additions and 66 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue