Changed the -21... to 0x80... to avoid integer overflow warnings
authorChristos Zoulas <christos@ucbvax.Berkeley.EDU>
Wed, 31 Mar 1993 04:55:45 +0000 (20:55 -0800)
committerChristos Zoulas <christos@ucbvax.Berkeley.EDU>
Wed, 31 Mar 1993 04:55:45 +0000 (20:55 -0800)
SCCS-vsn: bin/csh/set.c 5.19

usr/src/bin/csh/set.c

index e355d0e..027865d 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)set.c      5.18 (Berkeley) %G%";
+static char sccsid[] = "@(#)set.c      5.19 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -340,7 +340,7 @@ putn(n)
        *putp++ = '-';
     }
     num = 2;                   /* confuse lint */
        *putp++ = '-';
     }
     num = 2;                   /* confuse lint */
-    if (sizeof(int) == num && n == -32768) {
+    if (sizeof(int) == num && ((unsigned int) n) == 0x8000) {
        *putp++ = '3';
        n = 2768;
 #ifdef pdp11
        *putp++ = '3';
        n = 2768;
 #ifdef pdp11
@@ -349,7 +349,7 @@ putn(n)
     }
     else {
        num = 4;                /* confuse lint */
     }
     else {
        num = 4;                /* confuse lint */
-       if (sizeof(int) == num && n == -2147483648) {
+       if (sizeof(int) == num && ((unsigned int) n) == 0x80000000) {
            *putp++ = '2';
            n = 147483648;
        }
            *putp++ = '2';
            n = 147483648;
        }