9front - general discussion about 9front
 help / color / mirror / Atom feed
From: ori@eigenstate.org
To: 9front@9front.org
Subject: Re: [9front] [PATCH] cc: fix incorrect octal range condition in mpatov
Date: Sun, 23 Jan 2022 10:16:13 -0500	[thread overview]
Message-ID: <9D8D30876A965100ABCB967296080EA3@eigenstate.org> (raw)
In-Reply-To: <8EBA4C4DBE4E51D98D5F46A20255F163@arrow>

Quoth Michael Forney <mforney@mforney.org>:
> 
> This does not have any adverse effect, since yylex never calls mpatov
> with a string with leading 0 (and not 0x) that contains non-octal
> digits, but the condition was wrong regardless.
> ---
> diff 108d74cb0a8d27e82550d2772ae64fd7748e151d f101ca1299eb8d3ccafc9190651e98486948ec0d
> --- a/sys/src/cmd/cc/lex.c	Fri Jan  7 02:37:02 2022
> +++ b/sys/src/cmd/cc/lex.c	Sat Jan 22 17:05:27 2022
> @@ -982,7 +982,7 @@
>  	if(c == 'x' || c == 'X')
>  		goto hex;
>  	while(c = *s++) {
> -		if(c >= '0' || c <= '7')
> +		if(c >= '0' && c <= '7')
>  			nn = n*8 + c-'0';
>  		else
>  			goto bad;
> 

applied, thanks


      reply	other threads:[~2022-01-23 16:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-23  1:05 Michael Forney
2022-01-23 15:16 ` ori [this message]

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=9D8D30876A965100ABCB967296080EA3@eigenstate.org \
    --to=ori@eigenstate.org \
    --cc=9front@9front.org \
    /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.
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).