svn commit: [25943] trunk/busybox/shell

vda at busybox.net vda at busybox.net
Fri Apr 3 21:13:31 UTC 2009


Author: vda
Date: 2009-04-03 21:13:31 +0000 (Fri, 03 Apr 2009)
New Revision: 25943

Log:
shell/math: randomconfig fix



Modified:
   trunk/busybox/shell/math.c
   trunk/busybox/shell/math.h


Changeset:
Modified: trunk/busybox/shell/math.c
===================================================================
--- trunk/busybox/shell/math.c	2009-04-03 19:14:32 UTC (rev 25942)
+++ trunk/busybox/shell/math.c	2009-04-03 21:13:31 UTC (rev 25943)
@@ -414,14 +414,14 @@
 			rez %= numptr_val;
 	}
 	if (tok_have_assign(op)) {
-		char buf[sizeof(arith_t_type)*3 + 2];
+		char buf[sizeof(arith_t)*3 + 2];
 
 		if (numptr_m1->var == NULL) {
 			/* Hmm, 1=2 ? */
 			goto err;
 		}
 		/* save to shell variable */
-		snprintf(buf, sizeof(buf), arith_t_fmt, (arith_t_type) rez);
+		sprintf(buf, arith_t_fmt, rez);
 		setvar(numptr_m1->var, buf, 0);
 		/* after saving, make previous value for v++ or v-- */
 		if (op == TOK_POST_INC)
@@ -668,7 +668,7 @@
 	} /* while */
 }
 
-/*-
+/*
  * Copyright (c) 1989, 1991, 1993, 1994
  *      The Regents of the University of California.  All rights reserved.
  *

Modified: trunk/busybox/shell/math.h
===================================================================
--- trunk/busybox/shell/math.h	2009-04-03 19:14:32 UTC (rev 25942)
+++ trunk/busybox/shell/math.h	2009-04-03 21:13:31 UTC (rev 25943)
@@ -76,13 +76,11 @@
 #define _SHELL_MATH_
 
 #if ENABLE_SH_MATH_SUPPORT_64
-typedef int64_t arith_t;
-#define arith_t_type long long
+typedef long long arith_t;
 #define arith_t_fmt "%lld"
 #define strto_arith_t strtoll
 #else
 typedef long arith_t;
-#define arith_t_type long
 #define arith_t_fmt "%ld"
 #define strto_arith_t strtol
 #endif



More information about the busybox-cvs mailing list