summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-09-01 09:48:03 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-09-01 09:48:03 +0000
commit69a3aaf154948d653fa3653cd2b3c3b3af979769 (patch)
treef83116ebca291337b9948831c617217c18f6a317 /sprintf.c
parenta1b57d0add85a248666fb55c58aa8c0c772136fc (diff)
regexp literal (e.g. \202) match, etc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sprintf.c b/sprintf.c
index c3a2772..3c71e97 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -23,7 +23,7 @@ double strtod();
#ifdef USE_CWGUSI
static void fmt_setup();
#else
-static void fmt_setup _((char*,char,int,int,int));
+static void fmt_setup _((char*,int,int,int,int));
#endif
static char*
@@ -263,6 +263,9 @@ rb_f_sprintf(argc, argv)
p--;
case '\0':
case '%':
+ if (flags != FNONE) {
+ rb_raise(rb_eArgError, "illegal format character - %%");
+ }
PUSH("%", 1);
break;
@@ -620,7 +623,8 @@ rb_f_sprintf(argc, argv)
static void
fmt_setup(buf, c, flags, width, prec)
- char *buf, c;
+ char *buf;
+ int c;
int flags, width, prec;
{
*buf++ = '%';