diff options
author | rhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-13 12:33:13 +0000 |
---|---|---|
committer | rhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-13 12:33:13 +0000 |
commit | 4d97a5c3123bf7c271cc3007ac7029342558b01c (patch) | |
tree | b8f72758501d5fec20755a8de36c6a478c0902ef /ext/socket/raddrinfo.c | |
parent | 9312d98801e376223b55361631bcde1f0a8f908f (diff) | |
download | ruby-4d97a5c3123bf7c271cc3007ac7029342558b01c.tar.gz |
Use PRIuSIZE format specifier for size_t values
Use PRIuSIZE instead of PRIdSIZE. This fixes the exception message shown
on too large xmalloc2. This commit also fixes other incorrect use of
PRIdSIZE in other functions; though most of them are debug print.
* gc.c (heap_extend_pages, get_envparam_size, ruby_malloc_size_overflow,
gc_profile_dump_on): Use PRIuSIZE instead of PRIdSIZE as the passed
value is size_t, not ssize_t.
* iseq.c (get_line_info, rb_iseq_disasm_insn): Ditto.
* sprintf.c (rb_str_format): Ditto.
* thread_win32.c (native_thread_create): Ditto.
* vm.c (get_param): Ditto.
* ext/objspace/objspace_dump.c (dump_append_string_content,
dump_object): Ditto.
* ext/socket/raddrinfo.c (host_str, port_str): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/raddrinfo.c')
-rw-r--r-- | ext/socket/raddrinfo.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/socket/raddrinfo.c b/ext/socket/raddrinfo.c index 11f5d1f5a6..67bc9c2a97 100644 --- a/ext/socket/raddrinfo.c +++ b/ext/socket/raddrinfo.c @@ -462,7 +462,7 @@ host_str(VALUE host, char *hbuf, size_t hbuflen, int *flags_ptr) if (flags_ptr) *flags_ptr |= AI_NUMERICHOST; } else if (len >= hbuflen) { - rb_raise(rb_eArgError, "hostname too long (%"PRIdSIZE")", + rb_raise(rb_eArgError, "hostname too long (%"PRIuSIZE")", len); } else { @@ -493,7 +493,7 @@ port_str(VALUE port, char *pbuf, size_t pbuflen, int *flags_ptr) SafeStringValueCStr(port); RSTRING_GETMEM(port, serv, len); if (len >= pbuflen) { - rb_raise(rb_eArgError, "service name too long (%"PRIdSIZE")", + rb_raise(rb_eArgError, "service name too long (%"PRIuSIZE")", len); } memcpy(pbuf, serv, len); |