| 202 |
{ |
{ |
| 203 |
int len; |
int len; |
| 204 |
|
|
| 205 |
|
igetch(1); // Cleanup input buffer |
| 206 |
|
|
| 207 |
moveto(row, col); |
moveto(row, col); |
| 208 |
prints(prompt); |
prints(prompt); |
| 209 |
prints(buffer); |
prints(buffer); |
| 218 |
{ |
{ |
| 219 |
char buffer[LINE_BUFFER_LEN]; |
char buffer[LINE_BUFFER_LEN]; |
| 220 |
FILE *fin; |
FILE *fin; |
| 221 |
int i; |
size_t i; |
| 222 |
|
|
| 223 |
if ((fin = fopen(filename, "r")) == NULL) |
if ((fin = fopen(filename, "r")) == NULL) |
| 224 |
{ |
{ |
| 247 |
char buffer[LINE_BUFFER_LEN]; |
char buffer[LINE_BUFFER_LEN]; |
| 248 |
int ch = 0; |
int ch = 0; |
| 249 |
int input_ok, line, max_lines; |
int input_ok, line, max_lines; |
| 250 |
long int c_line_current = 0, c_line_total = 0; |
long int c_line_current = 0; |
| 251 |
|
long int c_line_total = 0; |
| 252 |
FILE *fin; |
FILE *fin; |
| 253 |
long *p_line_offsets; |
long *p_line_offsets; |
| 254 |
int len; |
long int len; |
| 255 |
int percentile; |
long int percentile; |
| 256 |
int loop = 1; |
int loop = 1; |
| 257 |
|
|
| 258 |
if ((fin = fopen(filename, "r")) == NULL) |
if ((fin = fopen(filename, "r")) == NULL) |
| 401 |
log_error("Error length exceeds buffer size: %d\n", len); |
log_error("Error length exceeds buffer size: %d\n", len); |
| 402 |
len = LINE_BUFFER_LEN - 1; |
len = LINE_BUFFER_LEN - 1; |
| 403 |
} |
} |
| 404 |
if (fgets(buffer, len + 1, fin) == NULL) |
if (fgets(buffer, (int)len + 1, fin) == NULL) |
| 405 |
{ |
{ |
| 406 |
log_error("Reach EOF\n"); |
log_error("Reach EOF\n"); |
| 407 |
break; |
break; |
| 423 |
{ |
{ |
| 424 |
char buffer[LINE_BUFFER_LEN]; |
char buffer[LINE_BUFFER_LEN]; |
| 425 |
|
|
| 426 |
str_space(buffer, 20 - strlen(BBS_current_section_name)); |
str_space(buffer, 20 - (int)strnlen(BBS_current_section_name, sizeof(BBS_current_section_name))); |
| 427 |
|
|
| 428 |
moveto(1, 0); |
moveto(1, 0); |
| 429 |
clrtoeol(); |
clrtoeol(); |
| 443 |
struct tm *tm_online; |
struct tm *tm_online; |
| 444 |
|
|
| 445 |
get_time_str(str_time, sizeof(str_time)); |
get_time_str(str_time, sizeof(str_time)); |
| 446 |
str_space(buffer, 33 - strlen(BBS_username)); |
str_space(buffer, 33 - (int)strnlen(BBS_username, sizeof(BBS_username))); |
| 447 |
|
|
| 448 |
time_online = time(0) - BBS_login_tm; |
time_online = time(0) - BBS_login_tm; |
| 449 |
tm_online = gmtime(&time_online); |
tm_online = gmtime(&time_online); |
| 466 |
char buffer[LINE_BUFFER_LEN]; |
char buffer[LINE_BUFFER_LEN]; |
| 467 |
FILE *fin; |
FILE *fin; |
| 468 |
static int line; |
static int line; |
| 469 |
int len; |
unsigned int len; |
| 470 |
int end_of_line; |
int end_of_line; |
| 471 |
|
|
| 472 |
clrline(3, 2 + ACTIVE_BOARD_HEIGHT); |
clrline(3, 2 + ACTIVE_BOARD_HEIGHT); |