* remote.c (read_frame): Split readchar/checksum calculation into
authorSteve Chamberlain <sac@cygnus>
Sat, 30 Jul 1994 05:04:03 +0000 (05:04 +0000)
committerSteve Chamberlain <sac@cygnus>
Sat, 30 Jul 1994 05:04:03 +0000 (05:04 +0000)
two parts since evaluation order is undefined.

gdb/ChangeLog
gdb/remote.c

index 1c3a954a4decef48b89c00c8edc7bfc71b00fb8c..51126908972aef564cee4f7c1ba51b71606220bf 100644 (file)
@@ -1,3 +1,8 @@
+Fri Jul 29 21:56:23 1994  Steve Chamberlain  (sac@jonny.cygnus.com)
+
+       * remote.c (read_frame):  Split readchar/checksum calculation into
+       two parts since evaluation order is undefined.
+
 Fri Jul 29 13:46:08 1994  Fred Fish  (fnf@cygnus.com)
 
         From Kevin A. Buettner (kev@cujo.geg.mot.com).
index d5b677e4eea67b2f7baed44a1aae243d65a2511e..828b06215b7cb8788f7383d53d1e02c2ce56e24f 100644 (file)
@@ -1231,8 +1231,8 @@ read_frame (buf)
 
            *bp = '\000';
 
-           pktcsum = fromhex (readchar (remote_timeout)) << 4
-             | fromhex (readchar (remote_timeout));
+           pktcsum = fromhex (readchar (remote_timeout)) << 4;
+           pktcsum |= fromhex (readchar (remote_timeout));
 
            if (csum == pktcsum)
              return 1;