summaryrefslogtreecommitdiff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/params.c2
-rw-r--r--Src/subst.c2
-rw-r--r--Src/system.h4
3 files changed, 5 insertions, 3 deletions
diff --git a/Src/params.c b/Src/params.c
index 192ca74ad..d655c3411 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -1651,7 +1651,7 @@ setstrvalue(Value v, char *val)
void
setnumvalue(Value v, mnumber val)
{
- char buf[DIGBUFSIZE], *p;
+ char buf[BDIGBUFSIZE], *p;
if (v->pm->flags & PM_READONLY) {
zerr("read-only variable: %s", v->pm->nam, 0);
diff --git a/Src/subst.c b/Src/subst.c
index 2113123ef..492778400 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -1994,7 +1994,7 @@ static char *
arithsubst(char *a, char **bptr, char *rest)
{
char *s = *bptr, *t;
- char buf[DIGBUFSIZE], *b = buf;
+ char buf[BDIGBUFSIZE], *b = buf;
mnumber v;
singsub(&a);
diff --git a/Src/system.h b/Src/system.h
index 1540e421f..42a5f1197 100644
--- a/Src/system.h
+++ b/Src/system.h
@@ -406,8 +406,10 @@ struct timezone {
/* DIGBUFSIZ is the length of a buffer which can hold the -LONG_MAX-1 *
* (or with ZSH_64_BIT_TYPE maybe -LONG_LONG_MAX-1) *
* converted to printable decimal form including the sign and the *
- * terminating null character. Below 0.30103 > lg 2. */
+ * terminating null character. Below 0.30103 > lg 2. *
+ * BDIGBUFSIZE is for a number converted to printable binary form. */
#define DIGBUFSIZE ((int)(((sizeof(zlong) * 8) - 1) * 0.30103) + 3)
+#define BDIGBUFSIZE ((int)((sizeof(zlong) * 8) + 4))
/* If your stat macros are broken, we will *
* just undefine them. */