From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17448 invoked from network); 17 Dec 2007 01:42:45 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 17 Dec 2007 01:42:45 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 65609 invoked from network); 17 Dec 2007 01:42:40 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 Dec 2007 01:42:40 -0000 Received: (qmail 15869 invoked by alias); 17 Dec 2007 01:42:36 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24273 Received: (qmail 15852 invoked from network); 17 Dec 2007 01:42:35 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 17 Dec 2007 01:42:35 -0000 Received: from virusfilter.dotsrc.org (bifrost [127.0.0.1]) by spamfilter.dotsrc.org (Postfix) with ESMTP id A33428058F54 for ; Mon, 17 Dec 2007 02:39:34 +0100 (CET) Received: from dot.blorf.net (dsl-74-220-69-132.cruzio.com [74.220.69.132]) by bifrost.dotsrc.org (Postfix) with ESMTP for ; Mon, 17 Dec 2007 02:39:34 +0100 (CET) Received: by dot.blorf.net (Postfix, from userid 1000) id 250798B69; Sun, 16 Dec 2007 17:42:31 -0800 (PST) Date: Sun, 16 Dec 2007 17:42:31 -0800 From: Wayne Davison To: Zsh hackers list Subject: Re: Compilation error in Src/Modules/curses.c on HP-UX Message-ID: <20071217014231.GF22518@blorf.net> References: <21585.1197814087@pws-pc> <20071216173733.GM982@prunille.vinc17.org> <20071216193143.ac75ef46.p.w.stephenson@ntlworld.com> <20071217004133.GB11772@sverige> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="GRPZ8SYKNexpdSJ7" Content-Disposition: inline In-Reply-To: <20071217004133.GB11772@sverige> User-Agent: Mutt/1.5.17 (2007-11-01) X-Virus-Scanned: ClamAV using ClamSMTP --GRPZ8SYKNexpdSJ7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Dec 17, 2007 at 12:41:33AM +0000, Paul Ackersviller wrote: > 1332 if (getyx(w->win, intarr[0], intarr[1]) == ERR || > 1333 getbegyx(w->win, intarr[2], intarr[3]) == ERR || > 1334 getmaxyx(w->win, intarr[4], intarr[5]) == ERR) These are all defined as returning void in both the linux docs and hp docs that I checked. So this checking of the return values is illegal. I didn't check-in the attached patch because my zsh build isn't building this code. ..wayne.. --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="zcurses.patch" --- Src/Modules/curses.c 14 Dec 2007 15:14:07 -0000 1.43 +++ Src/Modules/curses.c 17 Dec 2007 01:36:15 -0000 @@ -1329,9 +1329,14 @@ zccmd_position(const char *nam, char **a w = (ZCWin)getdata(node); /* Look no pointers: these are macros. */ - if (getyx(w->win, intarr[0], intarr[1]) == ERR || - getbegyx(w->win, intarr[2], intarr[3]) == ERR || - getmaxyx(w->win, intarr[4], intarr[5]) == ERR) + getyx(w->win, intarr[0], intarr[1]); + if (intarr[0] == -1) + return 1; + getbegyx(w->win, intarr[2], intarr[3]); + if (intarr[2] == -1) + return 1; + getmaxyx(w->win, intarr[4], intarr[5]); + if (intarr[4] == -1) return 1; array = (char **)zalloc(7*sizeof(char *)); --GRPZ8SYKNexpdSJ7--