--- parser3/src/classes/math.C 2002/06/25 13:36:44 1.20 +++ parser3/src/classes/math.C 2003/04/04 09:42:04 1.25 @@ -1,12 +1,12 @@ /** @file Parser: @b math parser class. - Copyright(c) 2001, 2002 ArtLebedev Group(http://www.artlebedev.com) + Copyright(c) 2001, 2003 ArtLebedev Group(http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) - - $Id: math.C,v 1.20 2002/06/25 13:36:44 paf Exp $ */ +static const char* IDENT_MATH_C="$Date: 2003/04/04 09:42:04 $"; + #include "pa_common.h" #include "pa_vint.h" #include "pa_vmath.h" @@ -47,11 +47,11 @@ static void _random(Request& r, const St Pool& pool=r.pool(); Value& range=params->as_junction(0, "range must be expression"); - double top=r.process_to_value(range).as_double(); - if(top<=1) + double top=r.process_to_value(range).as_double(); + if(top<=0) throw Exception("parser.runtime", &method_name, - "top must be above 1(%g)", top); + "top must be above 0(%g)", top); r.write_no_lang(*new(pool) VInt(pool, _random(uint(top)))); } @@ -163,7 +163,7 @@ static void _crypt(Request& r, const Str || strncmp(sample_buf, normal_salt, prefix_size)!=0) // salt prefix not preserved throw Exception("parser.runtime", &method_name, - "this platform does not support '%*s' salt prefix", prefix_size, normal_salt); + "on this platform does not support '%.*s' salt prefix", prefix_size, normal_salt); r.write_pass_lang(*new(pool) String(pool, sample_buf)); #else