diff options
| author | g8bpq <john.wiseman@cantab.net> | 2023-02-05 11:01:05 +0000 |
|---|---|---|
| committer | g8bpq <john.wiseman@cantab.net> | 2023-02-05 11:01:05 +0000 |
| commit | c32ef4ee1e742d14161b348d62f2c674a1a289e6 (patch) | |
| tree | 2b8c9ec4840b5965a3a6d70614d5d4ea21967ff1 /HanksRT.c | |
| parent | c15de2c7f7e70c97a89b591b3ece72c5047ab4fa (diff) | |
6.0.23.4623.51
Diffstat (limited to 'HanksRT.c')
| -rw-r--r-- | HanksRT.c | 19 |
1 files changed, 16 insertions, 3 deletions
@@ -730,6 +730,14 @@ VOID ProcessChatLine(ChatCIRCUIT * conn, struct UserInfo * user, char* OrigBuffe {
// Process Command
+ int cmdLen = 0;
+ char * param = strchr(&Buffer[1], ' ');
+
+ if (param)
+ cmdLen = param - &Buffer[1];
+ else
+ cmdLen = strlen(&Buffer[1]);
+
if (_memicmp(&Buffer[1], "Bye", 1) == 0)
{
SendUnbuffered(conn->BPQStream, ChatSignoffMsg, (int)strlen(ChatSignoffMsg));
@@ -767,15 +775,20 @@ VOID ProcessChatLine(ChatCIRCUIT * conn, struct UserInfo * user, char* OrigBuffe return;
}
- if (_memicmp(&Buffer[1], "History", 7) == 0)
+ if (_memicmp(&Buffer[1], "History", cmdLen) == 0)
{
// Param is number of minutes to go back (max 24 hours)
struct HistoryRec * ptr = History;
- int interval = atoi(&Buffer[9]) * 60;
- time_t start = time(NULL) - interval;
+ int interval = 0;
+ time_t start;
int n = HistoryCount;
+ if (param)
+ interval = atoi(param) * 60;
+
+ start = time(NULL) - interval;
+
if (interval < 1)
{
nprintf(conn, "Format is /history n, where n is history time in minutes\r");
|
