Skip to content

Commit 8b8f915

Browse files
committed
fix: replaced ssize_t with std::uint32_t
1 parent 4df4977 commit 8b8f915

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

others/serialization.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Serializer {
4141
* content.
4242
*/
4343
static void serialize(std::ofstream &out, const std::string &data) {
44-
ssize_t length = data.size();
44+
std::uint32_t length = data.size();
4545
serialize(out, length); // Serialize the length of the string.
4646
out.write(data.c_str(), length); // Serialize the string characters.
4747
out.put('|'); // Add a delimiter to denote the end of the string.
@@ -81,7 +81,7 @@ class Deserializer {
8181
* delimiter '|' is not found.
8282
*/
8383
static void deserialize(std::ifstream &in, std::string &data) {
84-
ssize_t length;
84+
std::uint32_t length;
8585
deserialize(in, length); // Deserialize the length of the string.
8686

8787
if (length > 1024 * 1024) // Sanity check to prevent huge strings.

0 commit comments

Comments
 (0)