diff options
Diffstat (limited to 'erts/emulator/beam/utils.c')
-rw-r--r-- | erts/emulator/beam/utils.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c index 1bd178f280..e4ad7dcb24 100644 --- a/erts/emulator/beam/utils.c +++ b/erts/emulator/beam/utils.c @@ -2955,14 +2955,14 @@ Eterm buf_to_intlist(Eterm** hpp, char *buf, int len, Eterm tail) { Eterm* hp = *hpp; + int i = len - 1; - buf += (len-1); - while(len > 0) { - tail = CONS(hp, make_small((byte)*buf), tail); + while(i >= 0) { + tail = CONS(hp, make_small((Uint)(byte)buf[i]), tail); hp += 2; - buf--; - len--; + --i; } + *hpp = hp; return tail; } |