summaryrefslogtreecommitdiff
path: root/ext/Socket
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-02-13 11:41:08 +0000
committerNicholas Clark <nick@ccl4.org>2010-04-24 21:18:06 +0100
commitbc354c7012685d70ce64e7f10221b03ea279af01 (patch)
tree738a136f145bb8560aeba9758248be067e6862a4 /ext/Socket
parenta24c654f07035713924a2c157a5149ef670f55a5 (diff)
downloadperl-bc354c7012685d70ce64e7f10221b03ea279af01.tar.gz
In Socket.xs, convert 3 croak()s to use %s and a constant string for the name.
This actually saves space, because xsubpp has to use each XS function's full name as a constant string to pass to newXS(), so any re-use of it is free.
Diffstat (limited to 'ext/Socket')
-rw-r--r--ext/Socket/Socket.xs7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs
index 2d469ed354..af76554058 100644
--- a/ext/Socket/Socket.xs
+++ b/ext/Socket/Socket.xs
@@ -254,7 +254,7 @@ inet_ntoa(ip_address_sv)
char * addr_str;
char * ip_address;
if (DO_UTF8(ip_address_sv) && !sv_utf8_downgrade(ip_address_sv, 1))
- croak("Wide character in Socket::inet_ntoa");
+ croak("Wide character in %s", "Socket::inet_ntoa");
ip_address = SvPVbyte(ip_address_sv, addrlen);
if (addrlen == sizeof(addr) || addrlen == 4)
addr.s_addr =
@@ -409,7 +409,7 @@ pack_sockaddr_in(port, ip_address_sv)
STRLEN addrlen;
char * ip_address;
if (DO_UTF8(ip_address_sv) && !sv_utf8_downgrade(ip_address_sv, 1))
- croak("Wide character in Socket::pack_sockaddr_in");
+ croak("Wide character in %s", "Socket::pack_sockaddr_in");
ip_address = SvPVbyte(ip_address_sv, addrlen);
if (addrlen == sizeof(addr) || addrlen == 4)
addr.s_addr =
@@ -474,7 +474,8 @@ inet_ntop(af, ip_address_sv)
} else if(af == AF_INET6) {
struct_size = sizeof(struct in6_addr);
} else {
- croak("Bad address family for Socket::inet_ntop, got %d, should be either AF_INET or AF_INET6",
+ croak("Bad address family for %s, got %d, should be either AF_INET or AF_INET6",
+ "Socket::inet_ntop",
af);
}