Actions
Feature #5219
closedArray#pack should warn (or raise) if an invalid pack string is given
Description
If garbage characters are inserted into the pack string ruby ignores them:
$ ruby19 -e 'p [1, 2, 3].pack("*N")'
"\x00\x00\x00\x01"
$ ruby19 -e 'p [1, 2, 3].pack("yN")'
"\x00\x00\x00\x01"
Ruby should at least warn like printf when -w is active:
$ ruby19 -we 'printf "%d %d", 1, 2, 3'
-e:1: warning: too many arguments for format string
A future version could raise an exception.
Files
Actions
Like0
Like0Like0Like0Like0