Граф коммитов

28 Коммитов

Автор SHA1 Сообщение Дата
nobu bae87a4790 vsnprintf.c: fix string precision
* vsnprintf.c (BSD_vfprintf): fix string width when precision is
  given.  as the result of `memchr` is NULL or its offset from the
  start cannot exceed the size, the comparison was always false.
  [ruby-core:62737] [Bug #9861]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-25 02:56:36 +00:00
ko1 ae411fb558 * vsnprintf.c: remove duplicated def of `UNINITIALIZED_VAR()'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05 05:42:52 +00:00
charliesome c4b6e96748 * vsnprintf.c: Fix spelling from compliment to complement.
Patch by @agrimm. Closes GH-422.

* include/ruby/ruby.h: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-13 14:53:40 +00:00
nobu 170344b20e vsnprintf.c: initialize cp
* vsnprintf.c (BSD_vfprintf): initialize cp so that size is 0 in the
  commented case.  fix an accidental bug at r16716.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-19 07:25:09 +00:00
nobu 88d28fb7cd vsnprintf.c: fix buffer overflow
* vsnprintf.c (MAXEXP, MAXFRACT): calculate depending on constants in
  float.h.
* vsnprintf.c (BSD_vfprintf): limit length for cvt() to get rid of
  buffer overflow.  [ruby-core:57023] [Bug #8864]
* vsnprintf.c (exponent): make expbuf size more precise.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-12 11:07:30 +00:00
nobu 31bea5d436 unecessary macros and K&R style coding
* strftime.c: remove unnecessary macros to check traditional C.
  https://github.com/ruby/ruby/pull/46 by lateau (Daehyub Kim).
* vsnprintf.c: remove K&R.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-16 00:46:12 +00:00
nobu 80aaa3ef6c sprintf.c: inspect by plus
* sprintf.c (ruby__sfvextra): [EXPERIMENTAL] use inspect instead of
  to_s if plus flag is given.
* vsnprintf.c (BSD_vfprintf): pass sign flag.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-24 16:15:42 +00:00
nobu ce8e2d5404 Feature #5896
* vsnprintf.c (BSD_vfprintf): [EXPERIMENTAL] object representation in
  rb_enc_vsprintf(). [Feature #5896]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-24 14:36:54 +00:00
naruse cd3445ca6e * vsnprintf.c (BSD_vfprintf): support 'll' prefix.
* vsnprintf.c (__sfeof): rename to avoid the collision with NetBSD's
  one.

* vsnprintf.c (__sferror): ditto.

* vsnprintf.c (__sclearerr): ditto.

* vsnprintf.c (__sfileno): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-01 04:31:52 +00:00
naruse b680cd7d05 * vsnprintf.c (cvt): set first byte of buf to NUL for the case when
no bytes are written to the buf. [ruby-dev:43062]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-18 17:56:10 +00:00
akr 4f1894a0b6 * vsnprintf.c: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-16 11:56:18 +00:00
naruse 3d38ba877e * vsnprintf.c (BSD__uqtoa): Fix overflow when long != quad_t.
patched by Peter Weldon <peter.weldon AT null.net>
  [ruby-core:33985]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-30 18:53:41 +00:00
kazu 7d0e6734df * vsnprintf.c (BSD_vfprintf): suppress warning: "_WIN32" is not defined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-18 12:55:06 +00:00
usa 99606f89c0 * vsnprintf (BSD_vfprintf): use QUADINT macro only when _HAVE_SANE_QUAD_
macro is defined.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-24 06:18:43 +00:00
usa 7329f4e92c * vsnprintf (BSD_vfprintf): added VC++ compatible size specifications
(I, I32, I64).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-24 03:50:03 +00:00
naruse 18c0fc890c * vsnprintf.c (BSD_vfprintf): don't output floating point
when the precision is 0. [ruby-dev:42615]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-22 16:06:38 +00:00
naruse 599a7071c1 * vsnprintf.c (BSD_vfprintf): fix precision specifier doesn't
work well on %f. [ruby-dev:42552]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-08 06:44:39 +00:00
nobu 67d7448fca * vsnprintf.c (BSD_vfprintf): suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-26 09:09:39 +00:00
nobu bbf0fd4e9c * vsnprintf.c (BSD_vfprintf): prec digits fractal part should be
appended to 0 if prec is given.  [ruby-dev:42453] #3979

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-24 21:21:40 +00:00
naruse e9240114a0 * vsnprintf.c (BSD_vfprintf): print floating point on "%#a".
[ruby-dev:42431] Bug#3965

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-20 01:03:18 +00:00
naruse fb796561f0 * vsnprintf.c (BSD_vfprintf): clear ALT flag for %a.
[ruby-core:32841] [ruby-core:32848]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-19 10:34:13 +00:00
nobu c511d26f6a * vsnprintf.c (BSD_vfprintf): fix over-count of field size.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-19 03:19:30 +00:00
nobu da55cfdf72 * vsnprintf.c (BSD_vfprintf): use HEXPREFIX flag for prefix of %a.
[ruby-core:32841]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-18 18:08:58 +00:00
naruse a7e8b12f96 * sprintf.c (BSD_vfprintf): wrong padding arround prefix and
floating point with %a. [ruby-dev:42403] Bug #3956

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-18 00:59:31 +00:00
nobu 85d1cba883 * vsnprintf.c (BSD_vfprintf): fix cast.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12 14:55:14 +00:00
nobu 45f6fbf339 * removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-29 18:51:39 +00:00
nobu d4bd694411 * vsnprintf.c (ruby_vsnprintf, ruby_snprintf): suppress warnings.
why return int in spite of the arguments of size_t?

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-28 01:27:37 +00:00
naruse b919cb1d93 * include/ruby/ruby.h: replace snprintf and vsnprintf by
ruby_snprintf and ruby_vsnprintf. [ruby-dev:40909]

* configure.in: don't check snprintf(3) and vsnprintf(3).

* include/ruby/missing.h: don't delare snprintf and vsnprintf.

* include/ruby/ruby.h: include stdarg.h.

* sprintf.c: include vsnprintf.c

* vsnprintf.c: renamed from missing/vsnprintf.c.

* vsnprintf.c: remove useless ifdefs.

* win32/mkexports.rb: use ruby_snprintf and ruby_vsnprintf.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-04 01:10:53 +00:00