aboutsummaryrefslogtreecommitdiffstats
path: root/ext/pty/pty.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pty/pty.c')
-rw-r--r--ext/pty/pty.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/pty/pty.c b/ext/pty/pty.c
index 4ba1cba621..f54bbb52e5 100644
--- a/ext/pty/pty.c
+++ b/ext/pty/pty.c
@@ -613,7 +613,7 @@ static void
raise_from_check(rb_pid_t pid, int status)
{
const char *state;
- char buf[1024];
+ VALUE msg;
VALUE exc;
#if defined(WIFSTOPPED)
@@ -631,8 +631,8 @@ raise_from_check(rb_pid_t pid, int status)
else {
state = "exited";
}
- snprintf(buf, sizeof(buf), "pty - %s: %ld", state, (long)pid);
- exc = rb_exc_new2(eChildExited, buf);
+ msg = rb_sprintf("pty - %s: %ld", state, (long)pid);
+ exc = rb_exc_new_str(eChildExited, msg);
rb_iv_set(exc, "status", rb_last_status_get());
rb_exc_raise(exc);
}