From 862f5da86db3b59d0660bb38387e8a0101b23e16 Mon Sep 17 00:00:00 2001 From: ceriel Date: Thu, 18 Nov 1993 15:35:03 +0000 Subject: [PATCH] use 0xFFFF mask for printing shorts, and work around gcc 2.4.5 bug --- util/cgg/main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/util/cgg/main.c b/util/cgg/main.c index 16d5b2561..449e79add 100644 --- a/util/cgg/main.c +++ b/util/cgg/main.c @@ -547,7 +547,11 @@ finishio() { while (*p) { register int c = (*p) & BMASK; if (! isascii(c) || iscntrl(c)) { - fprintf(cfile,"\\%c%c%c",((c>>6) &03)+'0', + /* The next line used to have (c>>6)&03, + but this triggered a bug in GCC 2.4.5 + on SPARC. + */ + fprintf(cfile,"\\%c%c%c",((*p>>6) &03)+'0', ((c>>3)&07)+'0',(c&07)+'0'); } else putc(c, cfile); @@ -559,7 +563,7 @@ finishio() { for(i=0;i