summaryrefslogtreecommitdiff
path: root/usr/src/lib/libcmd/common/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/libcmd/common/expr.c')
-rw-r--r--usr/src/lib/libcmd/common/expr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr/src/lib/libcmd/common/expr.c b/usr/src/lib/libcmd/common/expr.c
index 1baee2435e..ff5d45e039 100644
--- a/usr/src/lib/libcmd/common/expr.c
+++ b/usr/src/lib/libcmd/common/expr.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,7 +27,7 @@
*/
static const char usage[] =
-"[-?\n@(#)$Id: expr (AT&T Research) 2004-05-27 $\n]"
+"[-?\n@(#)$Id: expr (AT&T Research) 2008-01-30 $\n]"
USAGE_LICENSE
"[+NAME?expr - evaluate arguments as an expression]"
"[+DESCRIPTION?\bexpr\b evaluates an expression given as arguments and writes "
@@ -240,7 +240,7 @@ static int getnode(State_t* state, Node_t *np)
if (!(cp = *state->arglist++))
error(ERROR_exit(2), "position argument expected");
i = strtol(cp, &ep, 10);
- if (*ep || --i <= 0)
+ if (*ep || --i < 0)
i = -1;
if (!(cp = *state->arglist++))
error(ERROR_exit(2), "length argument expected");