summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--idle.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/idle.c b/idle.c
index ef588fd..bfb8fc8 100644
--- a/idle.c
+++ b/idle.c
@@ -112,9 +112,13 @@ write_bytes(char **pos, const char *bytes, size_t n)
static inline void
write_str(char **pos, const char *str)
{
+ size_t len;
+
assert_return(pos && *pos && !empty_str(str));
- write_bytes(pos, str, strlen(str));
+ len = strlen(str);
+ write_varint(pos, len);
+ write_bytes(pos, str, len);
}
static inline void