From ef099150a68e12bb4f03d552d703dde5a1c9e7c2 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 20 Jul 2011 15:55:07 +0000 Subject: [PATCH] Fix 'Duplicate Session' on Windows, broken during the config revamp. (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.) [originally from svn r9237] --- windows/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/window.c b/windows/window.c index b71f0bb0..d558cc95 100644 --- a/windows/window.c +++ b/windows/window.c @@ -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);