mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 03:22:48 -05:00
New functions to shrink a strbuf.
These are better than my previous approach of just assigning to sb->len, because firstly they check by assertion that the new length is within range, and secondly they preserve the invariant that the byte stored in the buffer just after the length runs out is \0. Switched to using the new functions everywhere a grep could turn up opportunities.
This commit is contained in:
@ -678,7 +678,7 @@ static void update_sessions(void)
|
||||
sb = strbuf_new();
|
||||
while(ERROR_SUCCESS == RegEnumKey(hkey, index_key, buf, MAX_PATH)) {
|
||||
if(strcmp(buf, PUTTY_DEFAULT) != 0) {
|
||||
sb->len = 0;
|
||||
strbuf_clear(sb);
|
||||
unescape_registry_key(buf, sb);
|
||||
|
||||
memset(&mii, 0, sizeof(mii));
|
||||
|
Reference in New Issue
Block a user