summaryrefslogtreecommitdiffhomepage
path: root/src/class.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-09-25 22:54:25 +0900
committerGitHub <[email protected]>2020-09-25 22:54:25 +0900
commit9ea7b718683386d2dc0787e919fc3d413ab20e67 (patch)
treea353c837094f8aab25a8e26474284ff78a151734 /src/class.c
parenta97f085c52c3a98ffd26e69ac1fd0d43dc83864c (diff)
parent57611240a972932ef26a13c6998a7fa90fd33371 (diff)
downloadmruby-9ea7b718683386d2dc0787e919fc3d413ab20e67.tar.gz
mruby-9ea7b718683386d2dc0787e919fc3d413ab20e67.zip
Merge pull request #5087 from dearblue/get-args-string
Prohibit string changes by "s"/"z" specifier of `mrb_get_args()`
Diffstat (limited to 'src/class.c')
-rw-r--r--src/class.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/class.c b/src/class.c
index fc8a38ff9..fcbdadea8 100644
--- a/src/class.c
+++ b/src/class.c
@@ -584,8 +584,8 @@ void mrb_hash_check_kdict(mrb_state *mrb, mrb_value self);
S: String [mrb_value] when ! follows, the value may be nil
A: Array [mrb_value] when ! follows, the value may be nil
H: Hash [mrb_value] when ! follows, the value may be nil
- s: String [char*,mrb_int] Receive two arguments; s! gives (NULL,0) for nil
- z: String [char*] NUL terminated string; z! gives NULL for nil
+ s: String [const char*,mrb_int] Receive two arguments; s! gives (NULL,0) for nil
+ z: String [const char*] NUL terminated string; z! gives NULL for nil
a: Array [mrb_value*,mrb_int] Receive two arguments; a! gives (NULL,0) for nil
c: Class/Module [strcut RClass*]
f: Fixnum/Float [mrb_float]
@@ -772,10 +772,10 @@ mrb_get_args(mrb_state *mrb, const char *format, ...)
case 's':
{
mrb_value ss;
- char **ps = 0;
+ const char **ps = 0;
mrb_int *pl = 0;
- ps = va_arg(ap, char**);
+ ps = va_arg(ap, const char**);
pl = va_arg(ap, mrb_int*);
if (i < argc) {
ss = argv[i++];