You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
janet:353:> (buffer/push-word @"" 1)
error in repl: bad slot #0, expected number, got @""
in cfunction buffer/push-word
in _thunk [repl] at (354:377) (tailcall)
Here is a patch
diff --git a/src/core/buffer.c b/src/core/buffer.c
index d318a6e..7987d79 100644
--- a/src/core/buffer.c
+++ b/src/core/buffer.c
@@ -192,7 +192,7 @@ static Janet cfun_buffer_word(int32_t argc, Janet *argv) {
janet_arity(argc, 1, -1);
JanetBuffer *buffer = janet_getbuffer(argv, 0);
for (i = 1; i < argc; i++) {
- double number = janet_getnumber(argv, 0);
+ double number = janet_getnumber(argv, i);
uint32_t word = (uint32_t) number;
if (word != number)
janet_panicf("cannot convert %v to machine word", argv[0]);
The text was updated successfully, but these errors were encountered:
I've found a little bug in buffer.c
Here is a patch
The text was updated successfully, but these errors were encountered: