Skip to content

Commit 52d3fa3

Browse files
chore: use uint32_t instead of ssize_t
1 parent 03549dd commit 52d3fa3

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
@@ -36,7 +36,7 @@ class Serializer {
3636
* content.
3737
*/
3838
static void serialize(std::ofstream &out, const std::string &data) {
39-
ssize_t length = data.size();
39+
std::uint32_t length = data.size();
4040
serialize(out, length); // Serialize the length of the string.
4141
out.write(data.c_str(), length); // Serialize the string characters.
4242
out.put('|'); // Add a delimiter to denote the end of the string.
@@ -76,7 +76,7 @@ class Deserializer {
7676
* delimiter '|' is not found.
7777
*/
7878
static void deserialize(std::ifstream &in, std::string &data) {
79-
ssize_t length;
79+
std::uint32_t length;
8080
deserialize(in, length); // Deserialize the length of the string.
8181

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

0 commit comments

Comments
 (0)