From 2875a9a71c1b77c67e4f3eda8f1aae591c13ecf4 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> Date: Fri, 12 Feb 1999 11:17:06 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'v1_3_1_990212'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_3_1_990212@401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- sprintf.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'sprintf.c') diff --git a/sprintf.c b/sprintf.c index 3c09a8ed2a..eddb9024e5 100644 --- a/sprintf.c +++ b/sprintf.c @@ -6,14 +6,22 @@ $Date$ created at: Fri Oct 15 10:39:26 JST 1993 - Copyright (C) 1993-1998 Yukihiro Matsumoto + Copyright (C) 1993-1999 Yukihiro Matsumoto ************************************************/ #include "ruby.h" #include +#ifndef atof +double strtod(); +#endif + +#ifdef USE_CWGUSI +static void fmt_setup(); +#else static void fmt_setup _((char*,char,int,int,int)); +#endif static char* remove_sign_bits(str, base) @@ -566,7 +574,7 @@ rb_f_sprintf(argc, argv) fval = rb_big2dbl(val); break; case T_STRING: - fval = atof(RSTRING(val)->ptr); + fval = strtod(RSTRING(val)->ptr, 0); break; default: Check_Type(val, T_FLOAT); @@ -585,7 +593,7 @@ rb_f_sprintf(argc, argv) } sprint_exit: - if (RTEST(rb_verbose) && argc > 1) { + if (RTEST(ruby_verbose) && argc > 1) { rb_raise(rb_eArgError, "too many argument for format string"); } result = rb_str_new(buf, blen); -- cgit v1.2.3