summaryrefslogtreecommitdiff
path: root/ext/bcmath/libbcmath/src/str2num.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bcmath/libbcmath/src/str2num.c')
-rw-r--r--ext/bcmath/libbcmath/src/str2num.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/bcmath/libbcmath/src/str2num.c b/ext/bcmath/libbcmath/src/str2num.c
index 0ea37d855f..f2d6a73501 100644
--- a/ext/bcmath/libbcmath/src/str2num.c
+++ b/ext/bcmath/libbcmath/src/str2num.c
@@ -39,7 +39,7 @@
/* Convert strings to bc numbers. Base 10 only.*/
-void
+int
bc_str2num (bc_num *num, char *str, int scale)
{
int digits, strscale;
@@ -62,7 +62,7 @@ bc_str2num (bc_num *num, char *str, int scale)
if ((*ptr != '\0') || (digits+strscale == 0))
{
*num = bc_copy_num (BCG(_zero_));
- return;
+ return *ptr == '\0';
}
/* Adjust numbers and allocate storage and initialize fields. */
@@ -107,4 +107,6 @@ bc_str2num (bc_num *num, char *str, int scale)
if (bc_is_zero (*num))
(*num)->n_sign = PLUS;
+
+ return 1;
}