Fix 'Duplicate Session' on Windows, broken during the config revamp.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 20 Jul 2011 15:55:07 +0000 (15:55 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 20 Jul 2011 15:55:07 +0000 (15:55 +0000)
(In an embarrassingly silly way, too. No end of difficult stuff about
Conf serialisation done with great care and working just fine, and
then a trivial goof in using sscanf lets the whole lot down.)

git-svn-id: svn://svn.tartarus.org/sgt/putty@9237 cda61777-01e9-0310-a592-d414129be87e

windows/window.c

index b71f0bb..d558cc9 100644 (file)
@@ -445,7 +445,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
            HANDLE filemap;
            void *cp;
            unsigned cpsize;
-           if (sscanf(p + 1, "%p:%u", &filemap, &cpsize) == 1 &&
+           if (sscanf(p + 1, "%p:%u", &filemap, &cpsize) == 2 &&
                (cp = MapViewOfFile(filemap, FILE_MAP_READ,
                                    0, 0, cpsize)) != NULL) {
                conf_deserialise(conf, cp, cpsize);