[PATCH] format-string error in ruby main.c

Svante Signell <[email protected]> Wed, 14 Aug 2013 16:58:37 +0200
Newsgroups gmane.comp.db.rrdtool.devel
Message-ID <[email protected]>
Hello,

Attached is an updated debian patch from 1.4.7-2 to avoid the error when
compiling bindings/ruby/main.c since the -Werror=format-security option
is enabled.

_______________________________________________
rrd-developers mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers
ruby_bindings_format_string.patch (text/x-patch, 786 B)
diff --git a/bindings/ruby/main.c b/bindings/ruby/main.c
index 21f6c0d..c35dfa8 100644
--- a/bindings/ruby/main.c
+++ b/bindings/ruby/main.c
@@ -27,7 +27,7 @@ typedef rrd_info_t *(
 
 #define RRD_CHECK_ERROR  \
     if (rrd_test_error()) \
-      rb_raise(rb_eRRDError, rrd_get_error()); \
+      rb_raise(rb_eRRDError, "%s", rrd_get_error()); \
     rrd_clear_error();
 
 string_arr string_arr_new(
@@ -56,7 +56,7 @@ string_arr string_arr_new(
             break;
         default:
             rb_raise(rb_eTypeError,
-                     "invalid argument - %s, expected T_STRING or T_FIXNUM on index %ld",
+                     "invalid argument - %s, expected T_STRING or T_FIXNUM on index %d",
                      rb_class2name(CLASS_OF(v)), i);
             break;
         }