sprintf.c: remove extra parentheses

* sprintf.c (GETASTER): remove extra parentheses from the second
  argument so that the error message does not contain them.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-06-26 13:30:08 +00:00
Родитель 767358108e
Коммит 57d6cb4af9
2 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -120,7 +120,7 @@ sign_bits(int base, const char *p)
#define GETASTER(val) do { \
t = p++; \
n = 0; \
GETNUM(n, (val)); \
GETNUM(n, val); \
if (*p == '$') { \
tmp = GETPOSARG(n); \
} \

Просмотреть файл

@ -309,6 +309,12 @@ class TestSprintf < Test::Unit::TestCase
def test_star
assert_equal("-1 ", sprintf("%*d", -3, -1))
assert_raise_with_message(ArgumentError, /width too big/) {
sprintf("%*999999999999999999999999999999999999999999999999999999999999$d", 1)
}
assert_raise_with_message(ArgumentError, /prec too big/) {
sprintf("%.*999999999999999999999999999999999999999999999999999999999999$d", 1)
}
end
def test_escape