9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Michael Forney <mforney@mforney.org>
To: 9front@9front.org
Subject: [9front] [PATCH] cc: fix incorrect octal range condition in mpatov
Date: Sun, 23 Jan 2022 01:05:27 +0000	[thread overview]
Message-ID: <8EBA4C4DBE4E51D98D5F46A20255F163@arrow> (raw)

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';
 			goto bad;

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

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

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8EBA4C4DBE4E51D98D5F46A20255F163@arrow \
    --to=mforney@mforney.org \
    --cc=9front@9front.org \


* 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).