diff options
Diffstat (limited to 'ext/bcmath/libbcmath/src')
-rw-r--r-- | ext/bcmath/libbcmath/src/bcmath.h | 2 | ||||
-rw-r--r-- | ext/bcmath/libbcmath/src/str2num.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/ext/bcmath/libbcmath/src/bcmath.h b/ext/bcmath/libbcmath/src/bcmath.h index cf6f854c52..becba7ec3e 100644 --- a/ext/bcmath/libbcmath/src/bcmath.h +++ b/ext/bcmath/libbcmath/src/bcmath.h @@ -108,7 +108,7 @@ _PROTOTYPE(bc_num bc_copy_num, (bc_num num)); _PROTOTYPE(void bc_init_num, (bc_num *num)); -_PROTOTYPE(void bc_str2num, (bc_num *num, char *str, int scale)); +_PROTOTYPE(int bc_str2num, (bc_num *num, char *str, int scale)); _PROTOTYPE(zend_string *bc_num2str_ex, (bc_num num, int scale)); 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; } |