summaryrefslogtreecommitdiffhomepage
path: root/src/sprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sprintf.c')
-rw-r--r--src/sprintf.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/src/sprintf.c b/src/sprintf.c
index 06e6b33d7..9a960e2cf 100644
--- a/src/sprintf.c
+++ b/src/sprintf.c
@@ -1,15 +1,8 @@
-/**********************************************************************
-
- sprintf.c -
-
- $Author: yugui $
- created at: Fri Oct 15 10:39:26 JST 1993
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
- Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
- Copyright (C) 2000 Information-technology Promotion Agency, Japan
-
-**********************************************************************/
+/*
+** sprintf.c - Kernel.#sprintf
+**
+** See Copyright Notice in mruby.h
+*/
#include "mruby.h"
#include <stdio.h>
@@ -26,10 +19,6 @@
#include <ieeefp.h>
#endif
-#ifndef MRB_TAINT_P
- #define MRB_TAINTED_P(p) FALSE
-#endif
-
#define BIT_DIGITS(N) (((N)*146)/485 + 1) /* log2(10) =~ 146/485 */
#define BITSPERDIG (sizeof(mrb_int)*CHAR_BIT)
#define EXTENDSIGN(n, l) (((~0 << (n)) >> (((n)*(l)) % BITSPERDIG)) & ~(~0 << (n)))
@@ -506,7 +495,6 @@ mrb_str_format(mrb_state *mrb, int argc, const mrb_value *argv, mrb_value fmt)
int width, prec, flags = FNONE;
int nextarg = 1;
int posarg = 0;
- int tainted = 0;
mrb_value nextvalue;
mrb_value tmp;
mrb_value str;
@@ -529,7 +517,6 @@ mrb_str_format(mrb_state *mrb, int argc, const mrb_value *argv, mrb_value fmt)
++argc;
--argv;
- if (MRB_TAINTED_P(fmt)) tainted = 1;
mrb_string_value(mrb, &fmt);
fmt = mrb_str_new4(mrb, fmt);
p = RSTRING_PTR(fmt);
@@ -733,7 +720,6 @@ format_s:
if (*p == 'p') arg = mrb_inspect(mrb, arg);
str = mrb_obj_as_string(mrb, arg);
- if (MRB_TAINTED_P(str)) tainted = 1;
len = RSTRING_LEN(str);
mrb_str_set_len(mrb, result, blen);
if (flags&(FPREC|FWIDTH)) {
@@ -825,7 +811,7 @@ bin_retry:
val = mrb_fixnum_value((mrb_int)mrb_float(val));
goto bin_retry;
}
- val = mrb_dbl2big(mrb, mrb_float(val));
+ val = mrb_flt2big(mrb, mrb_float(val));
if (FIXNUM_P(val)) goto bin_retry;
break;
case MRB_TT_STRING: