summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2021-06-07 07:17:36 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2021-06-07 07:18:17 +0900
commitcd64ddf3729038d1b0e9cd904a427d5142a0b39a (patch)
tree96f83eb97d77747d0fd4a11e2e8ce011306b356e
parente112c4628168a8ac1069e38b02ceec15b6ab277c (diff)
downloadmruby-cd64ddf3729038d1b0e9cd904a427d5142a0b39a.tar.gz
mruby-cd64ddf3729038d1b0e9cd904a427d5142a0b39a.zip
pack.c: raise exception for unsupported specifiers.
-rw-r--r--mrbgems/mruby-pack/src/pack.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mrbgems/mruby-pack/src/pack.c b/mrbgems/mruby-pack/src/pack.c
index 6da0a2c67..05d5d0875 100644
--- a/mrbgems/mruby-pack/src/pack.c
+++ b/mrbgems/mruby-pack/src/pack.c
@@ -1119,6 +1119,11 @@ alias:
type = PACK_TYPE_STRING;
flags |= PACK_FLAG_WIDTH | PACK_FLAG_COUNT2 | PACK_FLAG_Z;
break;
+ case 'p': case 'P':
+ case 'M': case 'X':
+ case '%': case '@':
+ mrb_raisef(mrb, E_ARGUMENT_ERROR, "%c is not supported", (char)t);
+ break;
default:
dir = PACK_DIR_INVALID;
type = PACK_TYPE_NONE;