diff options
author | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2007-04-21 12:46:49 +0000 |
---|---|---|
committer | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2007-04-21 12:46:49 +0000 |
commit | 5e4e31f76a18e45d88a24ce7b6efc07e420d805b (patch) | |
tree | 211ba4a724778fd6fa44d8e092ad6c34bb37de5f /Modules/posixmodule.c | |
parent | 8ff1f6a69e967951fb4de3049fbb847aacc901c8 (diff) | |
download | cpython-git-5e4e31f76a18e45d88a24ce7b6efc07e420d805b.tar.gz |
Fix various minor issues discovered with static analysis using Visual Studio 2005 Team System.
Removed obsolete comment, since .dll modules are no longer supported on windows, only .pyd.
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 958fb63d31..158b12e2ee 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -4788,18 +4788,19 @@ _PyPopenCreateProcess(char *cmdstring, (sizeof(modulepath)/sizeof(modulepath[0])) -strlen(modulepath)); if (stat(modulepath, &statinfo) != 0) { + size_t mplen = sizeof(modulepath)/sizeof(modulepath[0]); /* Eeek - file-not-found - possibly an embedding situation - see if we can locate it in sys.prefix */ strncpy(modulepath, Py_GetExecPrefix(), - sizeof(modulepath)/sizeof(modulepath[0])); + mplen); + modulepath[mplen-1] = '\0'; if (modulepath[strlen(modulepath)-1] != '\\') strcat(modulepath, "\\"); strncat(modulepath, szConsoleSpawn, - (sizeof(modulepath)/sizeof(modulepath[0])) - -strlen(modulepath)); + mplen-strlen(modulepath)); /* No where else to look - raise an easily identifiable error, rather than leaving Windows to report "file not found" - as the user is probably blissfully |