| 218 |
if (ch != KEY_NULL && ch != KEY_TIMEOUT) |
if (ch != KEY_NULL && ch != KEY_TIMEOUT) |
| 219 |
{ |
{ |
| 220 |
BBS_last_access_tm = time(NULL); |
BBS_last_access_tm = time(NULL); |
| 221 |
|
|
| 222 |
|
// Refresh current action |
| 223 |
|
if (user_online_update(NULL) < 0) |
| 224 |
|
{ |
| 225 |
|
log_error("user_online_update(NULL) error\n"); |
| 226 |
|
} |
| 227 |
} |
} |
| 228 |
|
|
| 229 |
switch (ch) |
switch (ch) |
| 230 |
{ |
{ |
| 231 |
case KEY_NULL: // broken pipe |
case KEY_NULL: // broken pipe |
| 232 |
|
#ifdef _DEBUG |
| 233 |
log_error("KEY_NULL\n"); |
log_error("KEY_NULL\n"); |
| 234 |
|
#endif |
| 235 |
case KEY_ESC: |
case KEY_ESC: |
| 236 |
case KEY_LEFT: |
case KEY_LEFT: |
| 237 |
return EXIT_LIST; // exit list |
return EXIT_LIST; // exit list |
| 508 |
// Verify format |
// Verify format |
| 509 |
for (i = 0, ok = 1; ok && username[i] != '\0'; i++) |
for (i = 0, ok = 1; ok && username[i] != '\0'; i++) |
| 510 |
{ |
{ |
| 511 |
if (!(isalpha(username[i]) || (i > 0 && (isdigit(username[i]) || username[i] == '_')))) |
if (!(isalpha((int)username[i]) || (i > 0 && (isdigit((int)username[i]) || username[i] == '_')))) |
| 512 |
{ |
{ |
| 513 |
ok = 0; |
ok = 0; |
| 514 |
} |
} |
| 564 |
break; |
break; |
| 565 |
default: |
default: |
| 566 |
i = (int)strnlen(username, sizeof(username) - 1); |
i = (int)strnlen(username, sizeof(username) - 1); |
| 567 |
if (i + 1 <= BBS_username_max_len && (isalnum((char)ch) || ch == '_')) |
if (i + 1 <= BBS_username_max_len && (isalnum(ch) || ch == '_')) |
| 568 |
{ |
{ |
| 569 |
username[i] = (char)ch; |
username[i] = (char)ch; |
| 570 |
username[i + 1] = '\0'; |
username[i + 1] = '\0'; |