diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-12-18 08:19:30 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-12-18 08:19:30 (GMT) |
commit | f8ed0044f62b4ce0c21ccb1873f6bf656cd8ac01 (patch) | |
tree | d3079bce81dded0e3024263ca152ea3bdee4f9b0 /PC/launcher.c | |
parent | 8bc2b4d5227871d25eeaac91cd64387cc27d6d74 (diff) | |
download | cpython-f8ed0044f62b4ce0c21ccb1873f6bf656cd8ac01.zip cpython-f8ed0044f62b4ce0c21ccb1873f6bf656cd8ac01.tar.gz cpython-f8ed0044f62b4ce0c21ccb1873f6bf656cd8ac01.tar.bz2 |
Issue #25889: Got rid of warning about mixing signed/unsigned char pointers.
Diffstat (limited to 'PC/launcher.c')
-rw-r--r-- | PC/launcher.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/PC/launcher.c b/PC/launcher.c index e414237..a94241b 100644 --- a/PC/launcher.c +++ b/PC/launcher.c @@ -1106,7 +1106,7 @@ maybe_handle_shebang(wchar_t ** argv, wchar_t * cmdline) */ FILE * fp; errno_t rc = _wfopen_s(&fp, *argv, L"rb"); - unsigned char buffer[BUFSIZE]; + char buffer[BUFSIZE]; wchar_t shebang_line[BUFSIZE + 1]; size_t read; char *p; @@ -1128,7 +1128,8 @@ maybe_handle_shebang(wchar_t ** argv, wchar_t * cmdline) fclose(fp); if ((read >= 4) && (buffer[3] == '\n') && (buffer[2] == '\r')) { - ip = find_by_magic((buffer[1] << 8 | buffer[0]) & 0xFFFF); + ip = find_by_magic((((unsigned char)buffer[1]) << 8 | + (unsigned char)buffer[0]) & 0xFFFF); if (ip != NULL) { debug(L"script file is compiled against Python %ls\n", ip->version); |