Will convert compose_convert_header needs for fixed buffers later.
This commit is contained in:
wwp 2017-01-16 18:29:15 +01:00
parent 989b3a3f51
commit 033bbdd7cd
3 changed files with 6 additions and 10 deletions

View file

@ -5564,13 +5564,15 @@ static gint compose_redirect_write_to_file(Compose *compose, FILE *fdest)
err |= (fputs(" (by way of ", fdest) == EOF);
if (compose->account->name
&& *compose->account->name) {
gchar buffer[BUFFSIZE];
compose_convert_header
(compose, buf, sizeof(buf),
(compose, buffer, sizeof(buffer),
compose->account->name,
strlen("From: "),
FALSE);
err |= (fprintf(fdest, "%s <%s>",
buf,
buffer,
compose->account->address) < 0);
} else
err |= (fprintf(fdest, "%s",

View file

@ -794,7 +794,7 @@ static void notification_convert_header(gchar **dest,
} else {
*dest = g_malloc(BUFFSIZE);
if (*dest)
conv_encode_header(*dest, sizeof(dest), src, header_len, FALSE);
conv_encode_header(*dest, BUFFSIZE, src, header_len, FALSE);
else
debug_print("notification_convert_header: alloc");
}

View file

@ -1155,13 +1155,7 @@ gint procheader_get_header_from_msginfo(MsgInfo *msginfo, gchar **buf, gchar *he
return -1;
}
val = procheader_get_one_field(buf, fp, hentry);
if (buf == NULL) {
claws_unlink(file);
g_free(file);
g_free(*buf);
*buf = NULL;
return -1;
}
if (fclose(fp) == EOF) {
FILE_OP_ERROR(file, "fclose");
claws_unlink(file);