Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Integer overflow during brace expansion
- X-seq: zsh-workers 30308
- From: Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>
- To: Peter Stephenson <Peter.Stephenson@xxxxxxx>
- Subject: Re: Integer overflow during brace expansion
- Date: Thu, 1 Mar 2012 08:20:01 -0800
- Authentication-results: mr.google.com; spf=pass (google.com: domain of 4wayned@xxxxxxxxx designates 10.152.132.130 as permitted sender) smtp.mail=4wayned@xxxxxxxxx; dkim=pass header.i=4wayned@xxxxxxxxx
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=4qasee5C8zXdyw047iLB6GopvhqtfnraAv3Bmr5Wn/Q=; b=FuxIiuWjkNNX6P6RxFOaCt4bc6VRCeZNDiz3zqTv8wCeZQBStT2JMb6zj7784Ym6kA Lda7W38d/8PAakONesmO7uwPDIItV6bN9vDkl0NY87RrBQr8jRcRaYMH6CpdFbW3oyZT kvQLWm07cPJEHzYzUGjHl8DCiSnySU5BeA8No=
- In-reply-to: <20120301143046.49093711@pwslap01u.europe.root.pri>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20120227162251.GA17559@zaphod.q-ix.net> <CAHYJk3SwmPTq0pNd2qa88kZV0beai9UjsyHeJK0Wh5csgm4=eg@mail.gmail.com> <CAHYJk3Skfz7xQcGv=r5t+-MQ_YCv0CGsmhK3k-9GnCwuV09-Uw@mail.gmail.com> <CAHYJk3TtwY7eUXRrB9DfoAva+LUoFTnyi4wVNBqR2WvB7NG=PQ@mail.gmail.com> <20120227173523.2941f24d@pwslap01u.europe.root.pri> <20120301143046.49093711@pwslap01u.europe.root.pri>
- Sender: 4wayned@xxxxxxxxx
On Thu, Mar 1, 2012 at 6:30 AM, Peter Stephenson
<Peter.Stephenson@xxxxxxx>wrote:
> + long long foo = (long long)400;
> + char buf[20];
> + sprintf(buf, "before%lldafter", foo);
> + if (!strcmp(buf, "before400after")) {
>
I think it'd be nice to get some higher bits involved in that check.
Perhaps something like this:
long long foo = ((long long)0xdead << 40) | 0xf00d;
compares to before62677660341432333after (and needs a larger buf).
..wayne..
Messages sorted by:
Reverse Date,
Date,
Thread,
Author