aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/utils.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-05-20 15:56:56 +0200
committerSverker Eriksson <[email protected]>2016-05-25 14:29:30 +0200
commitdcaa52d75e3bcbc808696597a34f2fca5677fff9 (patch)
treee2ea3b21d680442d31dbaaf51886b682b6f4e410 /erts/emulator/beam/utils.c
parentf9cb80861f169743a96099a06d68149a91f18dfa (diff)
downloadotp-dcaa52d75e3bcbc808696597a34f2fca5677fff9.tar.gz
otp-dcaa52d75e3bcbc808696597a34f2fca5677fff9.tar.bz2
otp-dcaa52d75e3bcbc808696597a34f2fca5677fff9.zip
erts: Make erlang:halt/2 truncate string arg
if too long.
Diffstat (limited to 'erts/emulator/beam/utils.c')
-rw-r--r--erts/emulator/beam/utils.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c
index cedc88e5fe..f0418446a8 100644
--- a/erts/emulator/beam/utils.c
+++ b/erts/emulator/beam/utils.c
@@ -3893,8 +3893,10 @@ void bin_write(int to, void *to_arg, byte* buf, size_t sz)
}
/* Fill buf with the contents of bytelist list
- return number of chars in list or -1 for error */
-
+ * return number of chars in list
+ * or -1 for type error
+ * or -2 for not enough buffer space (buffer contains truncated result)
+ */
Sint
intlist_to_buf(Eterm list, char *buf, Sint len)
{
@@ -3917,7 +3919,7 @@ intlist_to_buf(Eterm list, char *buf, Sint len)
return -1;
listptr = list_val(*(listptr + 1));
}
- return -1; /* not enough space */
+ return -2; /* not enough space */
}
/*