diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-01-05 00:54:29 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-01-05 00:54:29 (GMT) |
commit | b8584e0894863ca5d069889a30e7b4c4564ed416 (patch) | |
tree | 8edb11ff3b2f5d55678b5dbe53945c7e59d6b7d9 | |
parent | 1a7aab70d1f56b63ba6798db1cafe0a61cc3da15 (diff) | |
download | cpython-b8584e0894863ca5d069889a30e7b4c4564ed416.zip cpython-b8584e0894863ca5d069889a30e7b4c4564ed416.tar.gz cpython-b8584e0894863ca5d069889a30e7b4c4564ed416.tar.bz2 |
Fix signed/unsigned wng. Unfortunately, (unsigned char) << int
has type int in C.
-rw-r--r-- | Python/pythonrun.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 45d21dd..4dc2ddd 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -570,8 +570,8 @@ maybe_pyc_file(FILE *fp, char* filename, char* ext, int closeit) be read as they are on disk. */ unsigned int halfmagic = PyImport_GetMagicNumber() & 0xFFFF; unsigned char buf[2]; - if (fread(buf, 1, 2, fp) == 2 - && (buf[1]<<8 | buf[0]) == halfmagic) + if (fread(buf, 1, 2, fp) == 2 + && ((unsigned int)buf[1]<<8 | buf[0]) == halfmagic) return 1; fseek(fp, 0, SEEK_SET); } |