diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-09-01 09:48:03 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-09-01 09:48:03 +0000 |
commit | 1f72ff9b643dff5f4c5a40bf672a2525d66bd99f (patch) | |
tree | f83116ebca291337b9948831c617217c18f6a317 /sprintf.c | |
parent | aeb066503409062fc8fe8b241e512f5f6aebb128 (diff) | |
download | ruby-1f72ff9b643dff5f4c5a40bf672a2525d66bd99f.tar.gz ruby-1f72ff9b643dff5f4c5a40bf672a2525d66bd99f.tar.xz ruby-1f72ff9b643dff5f4c5a40bf672a2525d66bd99f.zip |
regexp literal (e.g. \202) match, etc.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r-- | sprintf.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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++ = '%'; |