Code

ensure we got long ints in ruby printfs
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sun, 18 Dec 2011 11:54:57 +0000 (11:54 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sun, 18 Dec 2011 11:54:57 +0000 (11:54 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.4/program@2246 a5681a0c-68f1-0310-ab6d-d61299d08faa

bindings/ruby/main.c

index 445eae3d2cc371e3b8ecae5486665b95f65b84ee..5096eef94cb3454e5a500e6c522f92081d457bc5 100644 (file)
@@ -51,13 +51,13 @@ string_arr string_arr_new(
             a.strings[i + 1] = strdup(StringValuePtr(v));
             break;
         case T_FIXNUM:
-            snprintf(buf, 63, "%d", FIX2INT(v));
+            snprintf(buf, 63, "%ld", (long)FIX2INT(v));
             a.strings[i + 1] = strdup(buf);
             break;
         default:
             rb_raise(rb_eTypeError,
-                     "invalid argument - %s, expected T_STRING or T_FIXNUM on index %d",
-                     rb_class2name(CLASS_OF(v)), i);
+                     "invalid argument - %s, expected T_STRING or T_FIXNUM on index %ld",
+                     (long)rb_class2name(CLASS_OF(v)), i);
             break;
         }
     }