Fix a couple of bugs, one in stralloc and one uninitialized ptr vector

This commit is contained in:
Andrew Pamment 2018-10-11 15:25:00 +10:00
parent 6d30116ed9
commit 15d09ed57a
2 changed files with 3 additions and 1 deletions

View File

@ -1454,6 +1454,8 @@ int read_message(struct user_record *user, struct msg_headers *msghs, int mailno
uuid_t magi_msgid;
struct ptr_vector msg_lines;
init_ptr_vector(&msg_lines);
jb = open_jam_base(conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->path);
if (!jb) {
dolog("Error opening JAM base.. %s", conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->path);

View File

@ -16,7 +16,7 @@ int stralloc_ready(stralloc *sa, size_t n) {
sa->s = malloc(n);
return sa != NULL;
}
if (sa->a <= n)
if (sa->a >= n)
return 1;
na = 30 + n + (n >> 3);
ns = realloc(sa->s, na);