summaryrefslogtreecommitdiff
path: root/ext/socket/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/socket.c')
-rw-r--r--ext/socket/socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index d2177e505da..383bc2983eb 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -1429,8 +1429,8 @@ sock_s_pack_sockaddr_un(VALUE self, VALUE path)
sockaddr.sun_family = AF_UNIX;
sun_path = StringValueCStr(path);
if (sizeof(sockaddr.sun_path) <= strlen(sun_path)) {
- rb_raise(rb_eArgError, "too long unix socket path (max: %dbytes)",
- (int)sizeof(sockaddr.sun_path)-1);
+ rb_raise(rb_eArgError, "too long unix socket path (%ldbytes given but %dbytes max)",
+ RSTRING_LEN(path), (int)sizeof(sockaddr.sun_path)-1);
}
strncpy(sockaddr.sun_path, sun_path, sizeof(sockaddr.sun_path)-1);
addr = rb_str_new((char*)&sockaddr, sizeof(sockaddr));