]> granicus.if.org Git - yasm/commitdiff
gas-preproc.c: Use sprintf instead of snprintf.
authorPeter Johnson <peter@tortall.net>
Wed, 13 Jan 2010 04:44:28 +0000 (04:44 -0000)
committerPeter Johnson <peter@tortall.net>
Wed, 13 Jan 2010 04:44:28 +0000 (04:44 -0000)
It's impossible for a decimal long string to be longer than 64 chars.

Also remove workaround for MSVC added in r2267.

svn path=/trunk/yasm/; revision=2273

modules/preprocs/gas/gas-preproc.c
util.h

index 4c125066acee7de807f648810996d3824402333b..0f659252a2b82e23352671a34d33f774299a3266 100644 (file)
@@ -770,7 +770,7 @@ static void substitute_values(yasm_preproc_gas *pp, char *line)
                 int cursor = pp->expr_string_cursor;
                 int k, len = strlen(tokval.t_charptr);
                 char value[64];
-                int value_length = snprintf(value, sizeof(value), "%ld", eval_expr(pp, tokval.t_charptr));
+                int value_length = sprintf(value, "%ld", eval_expr(pp, tokval.t_charptr));
                 int delta = value_length - len;
 
                 line_length += delta;
diff --git a/util.h b/util.h
index 27014f730df6b21b7d64521fae3c6341bc6abbad..132cba1e3db908010426d40b4cf3a5639def8477 100644 (file)
--- a/util.h
+++ b/util.h
 # define USE_OUR_OWN_STRCASECMP
 #endif
 
-#ifdef _MSC_VER
-# define snprintf                                              _snprintf
-#endif
-
 #include <libyasm/compat-queue.h>
 
 #ifdef HAVE_SYS_CDEFS_H