From bd1140f99a87bc735693942987d0a3de4f146631 Mon Sep 17 00:00:00 2001 From: vlefevre Date: Wed, 24 Sep 2003 00:36:19 +0000 Subject: Fixed comparisons (cases @NaN@ and @Inf@). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2436 280ebfd0-de03-0410-8827-d642c229c3f4 --- set_str.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'set_str.c') diff --git a/set_str.c b/set_str.c index c537478ea..f463abc8c 100644 --- a/set_str.c +++ b/set_str.c @@ -96,7 +96,7 @@ mpfr_set_str (mpfr_t x, const char *str, int base, mp_rnd_t rnd) if (base < 2 || base > 36) return -1; - if (strlen(str) >= 5 && strncasecmp (str, "@NaN@", 5) == 0) + if (strncasecmp (str, "@NaN@", 5) == 0) { MPFR_SET_NAN(x); /* MPFR_RET_NAN not used as the return value isn't a ternary value */ @@ -111,7 +111,7 @@ mpfr_set_str (mpfr_t x, const char *str, int base, mp_rnd_t rnd) /* be careful that 'inf' is a valid number in base >= 24, since i=18, n=23, f=15 */ - if (strlen(str) >= 3 && strncasecmp (str, "@Inf@", 5) == 0) + if (strncasecmp (str, "@Inf@", 5) == 0) { MPFR_CLEAR_NAN (x); MPFR_SET_INF (x); -- cgit v1.2.1