diff --git a/src/www_msgs.c b/src/www_msgs.c index 83c169f..18759dd 100644 --- a/src/www_msgs.c +++ b/src/www_msgs.c @@ -235,7 +235,16 @@ char *www_msgs_messagelist(struct user_record *user, int conference, int area, i } strcat(page, buffer); len += strlen(buffer); - + if (skip + 50 <= mhrs->msg_count) { + sprintf(buffer, "
Next
\n", conf.www_url, conference, area, skip + 50); + if (len + strlen(buffer) > max_len - 1) { + max_len += 4096; + page = (char *)realloc(page, max_len); + } + strcat(page, buffer); + len += strlen(buffer); + } + if (skip > 0) { if (skip - 50 < 0) { sprintf(buffer, "
Prev
\n", conf.www_url, conference, area); @@ -250,15 +259,6 @@ char *www_msgs_messagelist(struct user_record *user, int conference, int area, i len += strlen(buffer); } - if (skip + 50 <= mhrs->msg_count) { - sprintf(buffer, "
Next
\n", conf.www_url, conference, area, skip + 50); - if (len + strlen(buffer) > max_len - 1) { - max_len += 4096; - page = (char *)realloc(page, max_len); - } - strcat(page, buffer); - len += strlen(buffer); - } free_message_headers(mhrs); return page; }