| 892 |
} |
} |
| 893 |
else if (page_id < 0 || page_id >= *p_page_count) |
else if (page_id < 0 || page_id >= *p_page_count) |
| 894 |
{ |
{ |
| 895 |
|
#ifdef _DEBUG |
| 896 |
log_error("Invalid page_id=%d, not in range [0, %d)\n", page_id, *p_page_count); |
log_error("Invalid page_id=%d, not in range [0, %d)\n", page_id, *p_page_count); |
| 897 |
|
#endif |
| 898 |
ret = -3; |
ret = -3; |
| 899 |
} |
} |
| 900 |
else |
else |
| 933 |
: (page_id - p_section->page_count + 1) * BBS_article_limit_per_page - p_section->last_page_visible_article_count); |
: (page_id - p_section->page_count + 1) * BBS_article_limit_per_page - p_section->last_page_visible_article_count); |
| 934 |
while (*p_article_count < BBS_article_limit_per_page && i < p_section->ontop_article_count) |
while (*p_article_count < BBS_article_limit_per_page && i < p_section->ontop_article_count) |
| 935 |
{ |
{ |
| 936 |
p_articles[(*p_article_count)++] = p_section->p_ontop_articles[i++]; |
p_articles[*p_article_count] = p_section->p_ontop_articles[i++]; |
| 937 |
|
(*p_article_count)++; |
| 938 |
} |
} |
| 939 |
} |
} |
| 940 |
} |
} |
| 1018 |
p_article = section_list_find_article_with_offset(p_section, aid, &page_id, &offset, &p_tmp); |
p_article = section_list_find_article_with_offset(p_section, aid, &page_id, &offset, &p_tmp); |
| 1019 |
if (p_article != NULL) |
if (p_article != NULL) |
| 1020 |
{ |
{ |
| 1021 |
*p_article_count = (page_id == p_section->page_count - 1 ? p_section->last_page_visible_article_count : BBS_article_limit_per_page); |
*p_article_count = (page_id >= p_section->page_count - 1 ? p_section->last_page_visible_article_count : BBS_article_limit_per_page); |
| 1022 |
|
|
| 1023 |
p_article = p_section->p_page_first_article[page_id]; |
p_article = p_section->p_page_first_article[page_id]; |
| 1024 |
for (i = 0; i < *p_article_count && p_article != NULL;) |
for (i = 0; i < *p_article_count && p_article != NULL;) |