1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-06 05:52:48 -05:00

Rewrite conf deserialisation using BinarySource.

Like the corresponding rewrite of conf serialisation, this affects not
just conf_deserialise itself but also the per-platform filename and
fontspec deserialisers.
This commit is contained in:
Simon Tatham
2018-05-28 15:36:15 +01:00
parent e2431c3ef8
commit 876e1589f8
6 changed files with 68 additions and 134 deletions

View File

@ -480,7 +480,10 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
if (sscanf(p + 1, "%p:%u", &filemap, &cpsize) == 2 &&
(cp = MapViewOfFile(filemap, FILE_MAP_READ,
0, 0, cpsize)) != NULL) {
conf_deserialise(conf, cp, cpsize);
BinarySource src[1];
BinarySource_BARE_INIT(src, cp, cpsize);
if (!conf_deserialise(conf, src))
modalfatalbox("Serialised configuration data was invalid");
UnmapViewOfFile(cp);
CloseHandle(filemap);
} else if (!do_config()) {