aboutsummaryrefslogtreecommitdiff
path: root/src/database/database-redis.cpp
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2021-09-11 21:06:57 +0200
committerGitHub <noreply@github.com>2021-09-11 21:06:57 +0200
commit75bf9b75caba5fc876f20eabea3fabc142d1b51e (patch)
treec5a584838498760d0cb5e206795ead223d15527b /src/database/database-redis.cpp
parent766e885a1b1c5afb7a62f11b427b6d135adeab87 (diff)
downloadminetest-75bf9b75caba5fc876f20eabea3fabc142d1b51e.tar.gz
minetest-75bf9b75caba5fc876f20eabea3fabc142d1b51e.tar.bz2
minetest-75bf9b75caba5fc876f20eabea3fabc142d1b51e.zip
Make sure relevant std::stringstreams are set to binary
Diffstat (limited to 'src/database/database-redis.cpp')
-rw-r--r--src/database/database-redis.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/database/database-redis.cpp b/src/database/database-redis.cpp
index 096ea504d..5ffff67b7 100644
--- a/src/database/database-redis.cpp
+++ b/src/database/database-redis.cpp
@@ -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;
}