aboutsummaryrefslogtreecommitdiffstats
path: root/erts/lib_src/common/erl_printf.c
diff options
context:
space:
mode:
Diffstat (limited to 'erts/lib_src/common/erl_printf.c')
-rw-r--r--erts/lib_src/common/erl_printf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/erts/lib_src/common/erl_printf.c b/erts/lib_src/common/erl_printf.c
index 108a8bb531..399c83384e 100644
--- a/erts/lib_src/common/erl_printf.c
+++ b/erts/lib_src/common/erl_printf.c
@@ -173,6 +173,7 @@ typedef struct {
static int
write_sn(void *vwsnap, char* buf, size_t len)
{
+ int rv = 0;
write_sn_arg_t *wsnap = (write_sn_arg_t *) vwsnap;
ASSERT(wsnap);
ASSERT(len > 0);
@@ -180,12 +181,13 @@ write_sn(void *vwsnap, char* buf, size_t len)
size_t sz = len;
if (sz >= wsnap->len)
sz = wsnap->len;
+ rv = (int)sz;
memcpy((void *) wsnap->buf, (void *) buf, sz);
wsnap->buf += sz;
wsnap->len -= sz;
return sz;
}
- return 0;
+ return rv;
}
static int