Project

General

Profile

Bug #8916

rb_sprintf への精度指定が正しく機能していない

Added by tadf (tadayoshi funaba) over 3 years ago. Updated 27 days ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.1.0dev (2013-09-16 trunk 42949) [i686-linux]
[ruby-dev:47714]

Description

rb_sprintf への精度指定が正しく機能していない。

rb_sprintf("%.04d", -2) /* => "-002" */

format('%.4d', -2) #=> "-0002"

Associated revisions

Revision 58210
Added by nobu (Nobuyoshi Nakada) 27 days ago

vsnprintf.c: prefix with precision

  • vsnprintf.c (BSD_vfprintf): sign and hex-prefix should not be counted in precision. [Bug #8916]

History

#1 Updated by nobu (Nobuyoshi Nakada) 27 days ago

  • Status changed from Open to Closed

Applied in changeset trunk|r58210.


vsnprintf.c: prefix with precision

  • vsnprintf.c (BSD_vfprintf): sign and hex-prefix should not be counted in precision. [Bug #8916]

Also available in: Atom PDF