summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-11-05 09:42:16 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-11-05 09:42:16 +0000
commitd7731f785f41df24cd7db7bb1c8bf5c0a8905d70 (patch)
tree87161305a8119c678b675eca5662be38d25c8df7
parenta6085c3d3bb25a048cf19f67e3b551cf99bfe706 (diff)
interpret the following as " 040" and not as " "; augustss@cs.chalmers.se
.ascii "\040040"
-rw-r--r--gnu/usr.bin/gas/read.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gnu/usr.bin/gas/read.c b/gnu/usr.bin/gas/read.c
index 2d869de6b87..e7407fc3797 100644
--- a/gnu/usr.bin/gas/read.c
+++ b/gnu/usr.bin/gas/read.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: read.c,v 1.3 1996/12/21 21:50:55 tholo Exp $ */
+/* $OpenBSD: read.c,v 1.4 1997/11/05 09:42:15 deraadt Exp $ */
/* read.c - read a source file -
@@ -21,7 +21,7 @@
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef lint
-static char rcsid[] = "$OpenBSD: read.c,v 1.3 1996/12/21 21:50:55 tholo Exp $";
+static char rcsid[] = "$OpenBSD: read.c,v 1.4 1997/11/05 09:42:15 deraadt Exp $";
#endif
#define MASK_CHAR (0xFF) /* If your chars aren't 8 bits, you will
@@ -2086,8 +2086,11 @@ unsigned int next_char_of_string() {
case '8':
case '9': {
long number;
-
- for (number = 0; isdigit(c); c = *input_line_pointer++) {
+ int nchar;
+
+ for (nchar = 0, number = 0;
+ nchar < 3 && isdigit(c);
+ c = *input_line_pointer++, nchar++) {
number = number * 8 + c - '0';
}
c = number & 0xff;