[babl] babl_parse_double: permit 0 and 9 after .
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl] babl_parse_double: permit 0 and 9 after .
- Date: Sun, 21 Jun 2015 22:28:31 +0000 (UTC)
commit 5e31e447e7f5aa33d7ff8859d25008b93de7207e
Author: Øyvind Kolås <pippin gimp org>
Date: Sun Jun 21 22:25:41 2015 +0200
babl_parse_double: permit 0 and 9 after .
spotted by massimo, before this fix BABL_TOLERANCE < 0.1 and != 0 was not
possible.
babl/babl-internal.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/babl/babl-internal.h b/babl/babl-internal.h
index eb80dd0..ef5411f 100644
--- a/babl/babl-internal.h
+++ b/babl/babl-internal.h
@@ -305,7 +305,7 @@ static inline double babl_parse_double (const char *str)
{
char *p = strchr (str, '.') + 1;
double d = 10;
- for (;*p && *p > '0' && *p < '9';p++, d *= 10)
+ for (;*p && *p >= '0' && *p <= '9';p++, d *= 10)
{
if (result >= 0)
result += (*p - '0') / d;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]