summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
fe16501)
any session-save operation in PuTTYtel due to the empty GSS list.
git-svn-id: svn://svn.tartarus.org/sgt/putty@9276
cda61777-01e9-0310-a592-
d414129be87e
const char *s = val2key(mapping, nvals,
conf_get_int_int(conf, primary, i));
if (s) {
const char *s = val2key(mapping, nvals,
conf_get_int_int(conf, primary, i));
if (s) {
- maxlen += 1 + strlen(s);
+ maxlen += (maxlen > 0 ? 1 : 0) + strlen(s);
- buf = snewn(maxlen, char);
+ buf = snewn(maxlen + 1, char);
p = buf;
for (i = 0; i < nvals; i++) {
p = buf;
for (i = 0; i < nvals; i++) {
- assert(p - buf == maxlen - 1); /* maxlen counted the NUL */
+ assert(p - buf == maxlen);
+ *p = '\0';
write_setting_s(sesskey, name, buf);
write_setting_s(sesskey, name, buf);