]> asedeno.scripts.mit.edu Git - PuTTY.git/commit - misc.c
Add a 'strbuf' system, for building up a large string piece by piece.
authorSimon Tatham <anakin@pobox.com>
Sat, 21 Jan 2017 14:55:53 +0000 (14:55 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 21 Jan 2017 14:55:53 +0000 (14:55 +0000)
commit960ad594a313a91314a3984fc142bdfd11d136f5
tree49be19c71a536de9987407814bc632501ab0f348
parent23a9d5608c2c1bad56b14d6ec66b08f4c0401b5d
Add a 'strbuf' system, for building up a large string piece by piece.

I'm faintly surprised I haven't needed this before. Basically it's an
allocating string formatter, like dupprintf, except that it
concatenates on to the end of a previous string. You instantiate a
strbuf, then repeatedly call strbuf_catf to append pieces of formatted
output to it, and then you can extract the whole string and free it
(separately or both in one step).
misc.c
misc.h