From: oetiker Date: Sun, 18 Dec 2011 11:54:57 +0000 (+0000) Subject: ensure we got long ints in ruby printfs X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cc4b45c36580ca67d81212e60f67b3e5b6af672d;p=rrdtool.git ensure we got long ints in ruby printfs git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.4/program@2246 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/bindings/ruby/main.c b/bindings/ruby/main.c index 445eae3..5096eef 100644 --- a/bindings/ruby/main.c +++ b/bindings/ruby/main.c @@ -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; } }