Kaydet (Commit) b8584e08 authored tarafından Tim Peters's avatar Tim Peters

Fix signed/unsigned wng. Unfortunately, (unsigned char) << int

has type int in C.
üst 1a7aab70
...@@ -570,8 +570,8 @@ maybe_pyc_file(FILE *fp, char* filename, char* ext, int closeit) ...@@ -570,8 +570,8 @@ maybe_pyc_file(FILE *fp, char* filename, char* ext, int closeit)
be read as they are on disk. */ be read as they are on disk. */
unsigned int halfmagic = PyImport_GetMagicNumber() & 0xFFFF; unsigned int halfmagic = PyImport_GetMagicNumber() & 0xFFFF;
unsigned char buf[2]; unsigned char buf[2];
if (fread(buf, 1, 2, fp) == 2 if (fread(buf, 1, 2, fp) == 2
&& (buf[1]<<8 | buf[0]) == halfmagic) && ((unsigned int)buf[1]<<8 | buf[0]) == halfmagic)
return 1; return 1;
fseek(fp, 0, SEEK_SET); fseek(fp, 0, SEEK_SET);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment