about summary refs log tree commit homepage
path: root/ext/sleepy_penguin/value2timespec.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/sleepy_penguin/value2timespec.h')
-rw-r--r--ext/sleepy_penguin/value2timespec.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/sleepy_penguin/value2timespec.h b/ext/sleepy_penguin/value2timespec.h
index 8f6830b..b8f6167 100644
--- a/ext/sleepy_penguin/value2timespec.h
+++ b/ext/sleepy_penguin/value2timespec.h
@@ -42,8 +42,8 @@ static struct timespec *value2timespec(struct timespec *ts, VALUE num)
         }}
         {
                 VALUE tmp = rb_inspect(num);
-                rb_raise(rb_eTypeError, "can't convert %s into timespec",
-                         StringValuePtr(tmp));
+                const char *str = StringValueCStr(tmp);
+                rb_raise(rb_eTypeError, "can't convert %s into timespec", str);
         }
         rb_bug("rb_raise() failed, timespec failed");
         return NULL;