diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-01-05 00:54:29 +0000 |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-01-05 00:54:29 +0000 |
commit | 47d759775ebaf85a6c5e150f0ad9aa9477632038 (patch) | |
tree | 3b980ee44f2f2642c258c52b26ba64fac5b69211 /Python/pythonrun.c | |
parent | 1845f44125173b24a2de42aa506e354975d74239 (diff) | |
download | cpython-47d759775ebaf85a6c5e150f0ad9aa9477632038.tar.gz |
Fix signed/unsigned wng. Unfortunately, (unsigned char) << int
has type int in C.
Diffstat (limited to 'Python/pythonrun.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 45d21dd772..4dc2ddd8b7 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); } |