summaryrefslogtreecommitdiff
path: root/ext/zlib/zlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/zlib/zlib.c')
-rw-r--r--ext/zlib/zlib.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index df2a2501b2..391bec1722 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -337,11 +337,8 @@ raise_zlib_error(int err, const char *msg)
rb_sys_fail(msg);
/* no return */
default:
- {
- char buf[BUFSIZ];
- snprintf(buf, BUFSIZ, "unknown zlib error %d: %s", err, msg);
- exc = rb_exc_new2(cZError, buf);
- }
+ exc = rb_exc_new_str(cZError,
+ rb_sprintf("unknown zlib error %d: %s", err, msg));
}
rb_exc_raise(exc);