Couple of minor fixes

Duplicate string in www_email
fread returns number of elements read not number of bytes
Missing clear screen after my changing of strings
This commit is contained in:
Andrew Pamment 2018-10-14 10:46:52 +10:00
parent 303810acaa
commit b500a450dd
3 changed files with 3 additions and 2 deletions

View File

@ -422,6 +422,7 @@ void list_emails(struct user_record *user) {
position = 0;
while (!closed) {
if (redraw) {
s_printf("\e[2J\e[1;1H");
s_printf(get_string(126));
for (i = start; i < start + 22 && i < email_count; i++) {
localtime_r((time_t *)&emails[i]->date, &msg_date);

View File

@ -364,7 +364,7 @@ char *www_email_summary(struct user_record *user) {
if (seen != 0) {
stralloc_cats(&page, "-seen");
}
stralloc_cats(&page, "<div class=\"email-summary\"><div class=\"email-id\">");
stralloc_cats(&page, "\"><div class=\"email-id\">");
stralloc_cat_long(&page, msgid);
stralloc_cats(&page, "</div><div class=\"email-subject\"><a href=\"");
stralloc_cats(&page, conf.www_url);

View File

@ -16,7 +16,7 @@ char *www_last10() {
FILE *fptr = fopen("last10v2.dat", "rb");
if (fptr != NULL) {
for (; n < 10; ++n)
if (fread(&callers[n], sizeof(callers[n]), 1, fptr) != sizeof(callers[n]))
if (fread(&callers[n], sizeof(callers[n]), 1, fptr) != 1)
break;
fclose(fptr);
}