BDIGBUFSIZE for binary conversions.

This commit is contained in:
Bart Schaefer 2001-04-28 17:38:00 +00:00
parent 6f2112f23a
commit ba9541fb5d
4 changed files with 10 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2001-04-28 Bart Schaefer <schaefer@zsh.org>
* 14151: Src/params.c, Src/subst.c, Src/system.h: BDIGBUFSIZE is
the space needed to print a number converted to binary.
2001-04-27 Sven Wischnowsky <wischnow@zsh.org>
* 14133: Completion/Base/Completer/_expand,

View file

@ -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);

View file

@ -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);

View file

@ -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. */