summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog14
-rw-r--r--ext/bigdecimal/bigdecimal.c4
-rw-r--r--ext/dl/handle.c4
-rw-r--r--ext/gdbm/gdbm.c2
-rw-r--r--parse.y6
-rw-r--r--regparse.c4
6 files changed, 24 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 19e0aca6129..801e52d37da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+Sat Oct 14 23:25:31 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * parse.y (parser_warning, parser_warn): some error message may
+ contain format specifiers. a patch from Akinori MUSHA <knu at
+ iDaemons.org>. [ruby-dev:29657]
+
+ * regparse.c (onig_rb_warning, onig_rb_warn): ditto.
+
+ * ext/bigdecimal/bigdecimal.c (VpException): ditto.
+
+ * ext/dl/handle.c (rb_dlhandle_initialize): ditto.
+
+ * ext/gdbm/gdbm.c (rb_gdbm_fatal): ditto.
+
Sat Oct 14 08:15:42 2006 Akinori MUSHA <knu@iDaemons.org>
* ext/digest/digest.c, ext/digest/digest.h,
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index 4aa9b271928..f0e05a9799d 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -2206,8 +2206,8 @@ VpException(unsigned short f, const char *str,int always)
return 0; /* 0 Means VpException() raised no exception */
raise:
- if(fatal) rb_fatal(str);
- else rb_raise(exc,str);
+ if(fatal) rb_fatal("%s", str);
+ else rb_raise(exc, "%s", str);
return 0;
}
diff --git a/ext/dl/handle.c b/ext/dl/handle.c
index 3e644465ca5..24269dfd78f 100644
--- a/ext/dl/handle.c
+++ b/ext/dl/handle.c
@@ -70,12 +70,12 @@ rb_dlhandle_initialize(int argc, VALUE argv[], VALUE self)
ptr = dlopen(clib, cflag);
#if defined(HAVE_DLERROR)
if( !ptr && (err = dlerror()) ){
- rb_raise(rb_eDLError, err);
+ rb_raise(rb_eDLError, "%s", err);
}
#else
if( !ptr ){
err = dlerror();
- rb_raise(rb_eDLError, err);
+ rb_raise(rb_eDLError, "%s", err);
}
#endif
Data_Get_Struct(self, struct dl_handle, dlhandle);
diff --git a/ext/gdbm/gdbm.c b/ext/gdbm/gdbm.c
index c47df06ad63..7beffd2bdc2 100644
--- a/ext/gdbm/gdbm.c
+++ b/ext/gdbm/gdbm.c
@@ -81,7 +81,7 @@ static VALUE rb_cGDBM, rb_eGDBMError, rb_eGDBMFatalError;
static void
rb_gdbm_fatal(char *msg)
{
- rb_raise(rb_eGDBMFatalError, msg);
+ rb_raise(rb_eGDBMFatalError, "%s", msg);
}
struct dbmdata {
diff --git a/parse.y b/parse.y
index 8e6af853d5c..f82c7a90a85 100644
--- a/parse.y
+++ b/parse.y
@@ -6911,7 +6911,7 @@ parser_warning(NODE *node, const char *mesg)
{
int line = ruby_sourceline;
ruby_sourceline = nd_line(node);
- rb_warning(mesg);
+ rb_warning("%s", mesg);
ruby_sourceline = line;
}
@@ -6920,7 +6920,7 @@ parser_warn(NODE *node, const char *mesg)
{
int line = ruby_sourceline;
ruby_sourceline = nd_line(node);
- rb_warn(mesg);
+ rb_warn("%s", mesg);
ruby_sourceline = line;
}
@@ -9277,7 +9277,7 @@ ripper_assert_Qundef(VALUE self, VALUE obj, VALUE msg)
{
StringValue(msg);
if (obj == Qundef) {
- rb_raise(rb_eArgError, RSTRING_PTR(msg));
+ rb_raise(rb_eArgError, "%s", RSTRING_PTR(msg));
}
return Qnil;
}
diff --git a/regparse.c b/regparse.c
index 407b73fc44b..ba7e38e7f12 100644
--- a/regparse.c
+++ b/regparse.c
@@ -64,13 +64,13 @@ extern void onig_null_warn(const char* s) { }
extern void
onig_rb_warn(const char* s)
{
- rb_warn(s);
+ rb_warn("%s", s);
}
extern void
onig_rb_warning(const char* s)
{
- rb_warning(s);
+ rb_warning("%s", s);
}
#endif