summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2016-03-25 10:44:06 -0600
committerEduardo Chappa <chappa@washington.edu>2016-03-25 10:44:06 -0600
commit272f3b5774b673c55ebc970eb2b59436ef1e9d1b (patch)
treec149ca7e1ff32c7fefbfb298a75fe0228190d389
parent00ea1cca3ca866fee06eb66d13d330cab9390234 (diff)
downloadalpine-272f3b5774b673c55ebc970eb2b59436ef1e9d1b.tar.xz
* One more case where Alpine would not update the SETUP DIRECTORY
SERVERS screen correctly. I think I got them all now...
-rw-r--r--alpine/ldapconf.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/alpine/ldapconf.c b/alpine/ldapconf.c
index 0e5fa274..c051f625 100644
--- a/alpine/ldapconf.c
+++ b/alpine/ldapconf.c
@@ -1080,6 +1080,7 @@ dir_config_edit(struct pine *ps, CONF_S **cl)
char *subtitle;
int i, cnt;
char **new_list;
+ size_t sizeofsub;
for(cnt = 0; lval && lval[cnt]; cnt++)
;
@@ -1109,22 +1110,22 @@ dir_config_edit(struct pine *ps, CONF_S **cl)
if((*cl)->next->value)
fs_give((void **)&(*cl)->next->value);
- subtitle = (char *)fs_get((((info && info->serv && *info->serv)
- ? strlen(info->serv)
- : 3) +
- strlen(_(dserv)) + 15) *
- sizeof(char));
+ sizeofsub = (((info && info->serv && *info->serv)
+ ? strlen(info->serv)
+ : 3) + strlen(_(dserv)) + 15) * sizeof(char);
+
+ subtitle = (char *)fs_get(sizeofsub);
if(info && info->port >= 0)
- snprintf(subtitle, sizeof(subtitle), "%s%s:%d",
+ snprintf(subtitle, sizeofsub, "%s%s:%d",
_(dserv),
(info && info->serv && *info->serv) ? info->serv : "<?>",
info->port);
else
- snprintf(subtitle, sizeof(subtitle), "%s%s",
+ snprintf(subtitle, sizeofsub, "%s%s",
_(dserv),
(info && info->serv && *info->serv) ? info->serv : "<?>");
- subtitle[sizeof(subtitle)-1] = '\0';
+ subtitle[sizeofsub] = '\0';
(*cl)->next->value = subtitle;