From 0f6af49071e23facc3ab3ce664345d0affa2257e Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Thu, 31 May 2018 14:00:18 +1000 Subject: [PATCH] move next and prev around --- src/www_msgs.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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; }