fix ruby bindings to be compatible with curent ruby implementations fix for #279
[rrdtool.git] / bindings / ruby / main.c
index 6fe6a35..6dc229b 100644 (file)
@@ -48,7 +48,7 @@ string_arr string_arr_new(
 
         switch (TYPE(v)) {
         case T_STRING:
-            a.strings[i + 1] = strdup(STR2CSTR(v));
+            a.strings[i + 1] = strdup(StringValuePtr(v));
             break;
         case T_FIXNUM:
             snprintf(buf, 63, "%d", FIX2INT(v));
@@ -163,6 +163,7 @@ VALUE rb_rrd_infocall(
     VALUE     result;
 
     a = string_arr_new(args);
+    reset_rrd_state();
     data = func(a.len, a.strings);
     string_arr_delete(a);