aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2010-05-10 16:27:58 +0200
committerBjörn Gustavsson <[email protected]>2010-05-17 15:51:50 +0200
commit97ab480df55cf574ab42a87b6927ef5bba83000e (patch)
treea19bfd73bfb45d772c4fd54cad13c1050a6b59a3 /erts/emulator/beam
parentdce00e268eb36048a729db9a2a9aebd4df0e7395 (diff)
downloadotp-97ab480df55cf574ab42a87b6927ef5bba83000e.tar.gz
otp-97ab480df55cf574ab42a87b6927ef5bba83000e.tar.bz2
otp-97ab480df55cf574ab42a87b6927ef5bba83000e.zip
Add documentation for binary module
Correct behaviour of copy/2 witn 0 copies.
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/erl_bif_binary.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_bif_binary.c b/erts/emulator/beam/erl_bif_binary.c
index 0a40e28474..3e8480324c 100644
--- a/erts/emulator/beam/erl_bif_binary.c
+++ b/erts/emulator/beam/erl_bif_binary.c
@@ -2369,7 +2369,8 @@ static BIF_RETTYPE do_binary_copy(Process *p, Eterm bin, Eterm en)
goto badarg;
}
if (!n) {
- goto badarg;
+ Eterm res_term = erts_new_heap_binary(p,NULL,0,&bytes);
+ BIF_RET(res_term);
}
ERTS_GET_BINARY_BYTES(bin,bytes,bit_offs,bit_size);
if (bit_size != 0) {