Petr Onderka has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/79203


Change subject: Fixed bug when reading empty string
......................................................................

Fixed bug when reading empty string

Change-Id: I85399aabcd68fd7769f07b4c9e695caa7995b144
---
M DumpObjects/DumpTraits.h
1 file changed, 2 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dumps/incremental 
refs/changes/03/79203/1

diff --git a/DumpObjects/DumpTraits.h b/DumpObjects/DumpTraits.h
index 4916e04..faa5a9f 100644
--- a/DumpObjects/DumpTraits.h
+++ b/DumpObjects/DumpTraits.h
@@ -18,8 +18,6 @@
 using std::ostream;
 using std::vector;
 
-// TODO: add non-template wrapper with template methods, so that type 
inference can work?
-
 template<typename T, typename = void>
 class DumpTraits
 {
@@ -193,7 +191,8 @@
     {
         std::string bytes(count, '\0');
 
-        stream.read(&bytes.at(0), count);
+        if (count > 0)
+            stream.read(&bytes.at(0), count);
 
         return bytes;
     }

-- 
To view, visit https://gerrit.wikimedia.org/r/79203
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I85399aabcd68fd7769f07b4c9e695caa7995b144
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps/incremental
Gerrit-Branch: gsoc
Gerrit-Owner: Petr Onderka <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to