From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16315 invoked from network); 28 Apr 2001 17:28:40 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 28 Apr 2001 17:28:40 -0000 Received: (qmail 18795 invoked by alias); 28 Apr 2001 17:28:33 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14151 Received: (qmail 18763 invoked from network); 28 Apr 2001 17:28:32 -0000 From: "Bart Schaefer" Message-Id: <1010428172706.ZM31220@candle.brasslantern.com> Date: Sat, 28 Apr 2001 17:27:05 +0000 In-Reply-To: <20010428181541.A5537@exodus> Comments: In reply to Andre Pang "zsh segfaults on $(( [#2] 0xDEADBEEF ))" (Apr 28, 6:15pm) References: <20010428181541.A5537@exodus> X-Mailer: Z-Mail (5.0.0 30July97) To: Andre Pang , zsh-workers@sunsite.auc.dk Subject: PATCH: Re: zsh segfaults on $(( [#2] 0xDEADBEEF )) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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