summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-pack
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-08-04 17:50:09 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-08-04 17:50:09 +0900
commitcfb799a18e5adf8166e7ec72e2066da38062df1b (patch)
tree95b2c8d780746d98564077531eabfb8265e5418f /mrbgems/mruby-pack
parent43443d9377212844b84bc0440a8c35c4adfbb5d6 (diff)
downloadmruby-cfb799a18e5adf8166e7ec72e2066da38062df1b.tar.gz
mruby-cfb799a18e5adf8166e7ec72e2066da38062df1b.zip
Fix wrong condition for `PACK_DIR_HEX`; ref #5057
Diffstat (limited to 'mrbgems/mruby-pack')
-rw-r--r--mrbgems/mruby-pack/src/pack.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mrbgems/mruby-pack/src/pack.c b/mrbgems/mruby-pack/src/pack.c
index 8169a90b5..80de397f4 100644
--- a/mrbgems/mruby-pack/src/pack.c
+++ b/mrbgems/mruby-pack/src/pack.c
@@ -1298,11 +1298,12 @@ mrb_pack_pack(mrb_state *mrb, mrb_value ary)
default:
break;
}
- if (dir == PACK_DIR_STR || dir == PACK_DIR_BASE64) { /* always consumes 1 entry */
+ if (dir == PACK_DIR_STR || dir == PACK_DIR_BASE64 || dir == PACK_DIR_HEX) {
+ /* always consumes 1 entry */
aidx++;
break;
}
- if (!(flags & PACK_FLAG_COUNT2) && count > 0) {
+ if (count > 0) {
count--;
}
}