From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Andre Pang <ozone@algorithm.com.au>, zsh-workers@sunsite.auc.dk
Subject: PATCH: Re: zsh segfaults on $(( [#2] 0xDEADBEEF ))
Date: Sat, 28 Apr 2001 17:27:05 +0000 [thread overview]
Message-ID: <1010428172706.ZM31220@candle.brasslantern.com> (raw)
In-Reply-To: <20010428181541.A5537@exodus>
Well, this one wasn't difficult, at least.
Index: Src/params.c
===================================================================
--- Src/params.c 2001/04/26 04:20:57 1.4
+++ Src/params.c 2001/04/28 17:16:06
@@ -1651,7 +1651,7 @@
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);
Index: Src/subst.c
===================================================================
--- Src/subst.c 2001/04/26 04:20:58 1.2
+++ Src/subst.c 2001/04/28 17:16:03
@@ -1994,7 +1994,7 @@
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);
Index: Src/system.h
===================================================================
--- Src/system.h 2001/04/21 22:22:54 1.2
+++ Src/system.h 2001/04/28 17:15:14
@@ -406,8 +406,10 @@
/* 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) + 3))
/* If your stat macros are broken, we will *
* just undefine them. */
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
next prev parent reply other threads:[~2001-04-28 17:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-28 8:15 Andre Pang
2001-04-28 9:11 ` Andrej Borsenkow
2001-04-28 17:27 ` Bart Schaefer [this message]
2001-04-28 17:38 ` PATCH: " Bart Schaefer
2001-05-01 9:33 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1010428172706.ZM31220@candle.brasslantern.com \
--to=schaefer@candle.brasslantern.com \
--cc=ozone@algorithm.com.au \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).