From 2d0afa36a8fc2ccbfc72e6ea5073b4cd51503c37 Mon Sep 17 00:00:00 2001 From: zwelch Date: Wed, 17 Jun 2009 00:31:06 +0000 Subject: Ensure range errors are reported only when errno indicates one occurred. git-svn-id: svn://svn.berlios.de/openocd/trunk@2260 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/helper/command.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helper/command.c b/src/helper/command.c index 5dbc047e..bea480cc 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -872,9 +872,9 @@ long jim_global_long(const char *variable) *ul = func(str, &end, 0); \ if (*end) \ return ERROR_COMMAND_ARGUMENT_INVALID; \ - if (*ul == max) \ + if ((max == *ul) && (ERANGE == errno)) \ return ERROR_COMMAND_ARGUMENT_OVERFLOW; \ - if (min && min == *ul) \ + if (min && (min == *ul) && (ERANGE == errno)) \ return ERROR_COMMAND_ARGUMENT_UNDERFLOW; \ return ERROR_OK; \ } -- cgit v1.2.3