summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sprintf.c b/sprintf.c
index b89f441708..70bd270f2b 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -291,10 +291,12 @@ rb_f_sprintf(argc, argv)
break;
case 's':
+ case 'p':
{
VALUE arg = GETARG();
long len;
+ if (*p == 'p') arg = rb_inspect(arg);
str = rb_obj_as_string(arg);
if (OBJ_TAINTED(str)) tainted = 1;
len = RSTRING(str)->len;