1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00
putty-source/windows
Simon Tatham 1547c9c1ec Make dupcat() into a variadic macro.
Up until now, it's been a variadic _function_, whose argument list
consists of 'const char *' ASCIZ strings to concatenate, terminated by
one containing a null pointer. Now, that function is dupcat_fn(), and
it's wrapped by a C99 variadic _macro_ called dupcat(), which
automatically suffixes the null-pointer terminating argument.

This has three benefits. Firstly, it's just less effort at every call
site. Secondly, it protects against the risk of accidentally leaving
off the NULL, causing arbitrary words of stack memory to be
dereferenced as char pointers. And thirdly, it protects against the
more subtle risk of writing a bare 'NULL' as the terminating argument,
instead of casting it explicitly to a pointer. That last one is
necessary because C permits the macro NULL to expand to an integer
constant such as 0, so NULL by itself may not have pointer type, and
worse, it may not be marshalled in a variadic argument list in the
same way as a pointer. (For example, on a 64-bit machine it might only
occupy 32 bits. And yet, on another 64-bit platform, it might work
just fine, so that you don't notice the mistake!)

I was inspired to do this by happening to notice one of those bare
NULL terminators, and thinking I'd better check if there were any
more. Turned out there were quite a few. Now there are none.
2019-10-14 19:42:37 +01:00
..
installer.wxs Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
msiplatform.py Fix platform field in Windows on Arm installers. 2018-08-21 07:17:06 +01:00
pageant.ico Tweak the icon script, and the generated icons, to more closely 2007-01-07 10:17:12 +00:00
pageant.mft Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
pageant.rc Grow the Windows Licence dialog. 2019-03-18 20:32:55 +00:00
pageants.ico Tweak the icon script, and the generated icons, to more closely 2007-01-07 10:17:12 +00:00
plink.rc `win-versioninfo': all builds of all Windows binaries now contain 2005-10-04 14:13:28 +00:00
pscp.ico Tweak the icon script, and the generated icons, to more closely 2007-01-07 10:17:12 +00:00
pscp.rc `win-versioninfo': all builds of all Windows binaries now contain 2005-10-04 14:13:28 +00:00
psftp.rc `win-versioninfo': all builds of all Windows binaries now contain 2005-10-04 14:13:28 +00:00
putty.ico Tweak the icon script, and the generated icons, to more closely 2007-01-07 10:17:12 +00:00
putty.mft Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
putty.rc Tweak version string resources for EMBED_CHM. 2019-03-16 12:25:23 +00:00
puttycfg.ico Tweak the icon script, and the generated icons, to more closely 2007-01-07 10:17:12 +00:00
puttygen.ico Tweak the icon script, and the generated icons, to more closely 2007-01-07 10:17:12 +00:00
puttygen.mft Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
puttygen.rc Grow the Windows Licence dialog. 2019-03-18 20:32:55 +00:00
puttyins.ico `installer.ico' doesn't fit into 8.3, so gets truncated to INSTALLE.ICO in 2007-02-06 22:39:15 +00:00
puttytel.mft Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
puttytel.rc Tweak version string resources for EMBED_CHM. 2019-03-16 12:25:23 +00:00
rcstuff.h Remove Makefile.bor. 2017-09-13 19:26:28 +01:00
README-msi.txt Remove note about .CHM on network drives. 2019-03-18 21:53:45 +00:00
sizetip.c Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
version.rc2 FIXME about Windows resource CHMfulness hint. 2019-03-18 22:02:13 +00:00
website.url Switch chiark URLs to https. 2017-05-07 16:29:01 +01:00
win_res.h Stop looking for putty.chm alongside the binary. 2019-03-16 12:25:23 +00:00
win_res.rc2 Grow the Windows Licence dialog. 2019-03-18 20:32:55 +00:00
wincapi.c Convert a lot of 'int' variables to 'bool'. 2018-11-03 13:45:00 +00:00
wincapi.h Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
wincfg.c Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
wincons.c Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
winctrls.c Convert a few more universal asserts to unreachable(). 2019-09-09 19:12:02 +01:00
windefs.c Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
windlg.c Make dupcat() into a variadic macro. 2019-10-14 19:42:37 +01:00
window.c Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
wingss.c Make dupcat() into a variadic macro. 2019-10-14 19:42:37 +01:00
winhandl.c Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
winhelp.c Remove most traces of WinHelp support. 2019-03-26 00:27:04 +00:00
winhelp.h Remove most traces of WinHelp support. 2019-03-26 00:27:04 +00:00
winhelp.rc2 Tweak version string resources for EMBED_CHM. 2019-03-16 12:25:23 +00:00
winhsock.c Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
winjump.c Make dupcat() into a variadic macro. 2019-10-14 19:42:37 +01:00
winmisc.c Make dupcat() into a variadic macro. 2019-10-14 19:42:37 +01:00
winmiscs.c Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
winnet.c winnet: use SO_EXCLUSIVEADDRUSE for listening sockets. 2019-09-19 18:12:22 +01:00
winnohlp.c Stop looking for putty.chm alongside the binary. 2019-03-16 12:25:23 +00:00
winnoise.c Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
winnojmp.c Fix up svn:eol-style and svn:keywords on new files. 2010-12-27 00:24:48 +00:00
winnpc.c Move all extern declarations into header files. 2018-11-03 13:47:29 +00:00
winnps.c Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
winpgen.c Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
winpgnt.c Make dupcat() into a variadic macro. 2019-10-14 19:42:37 +01:00
winpgntc.c Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
winplink.c Windows Plink: fix segfault at startup when connection-sharing. 2019-09-19 17:59:37 +01:00
winprint.c Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
winproxy.c Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
winsecur.c Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
winsecur.h Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
winser.c Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
winsftp.c Make dupcat() into a variadic macro. 2019-10-14 19:42:37 +01:00
winshare.c Access all hashes and MACs through the standard API. 2019-01-20 17:09:24 +00:00
winstore.c Make dupcat() into a variadic macro. 2019-10-14 19:42:37 +01:00
winstuff.h Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
wintime.c wintime: add a precautionary memset to zero. 2017-02-14 23:25:25 +00:00
winucs.c Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
winutils.c Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
winx11.c Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00