summaryrefslogtreecommitdiff
path: root/BBSUtilities.c
diff options
context:
space:
mode:
authorDave Hibberd <d@vehibberd.com>2023-08-28 20:39:34 +0100
committerDave Hibberd <d@vehibberd.com>2023-08-28 20:39:34 +0100
commit95a6ab069f03d9a60b3f0a4b3f9ed0607f6e9ad6 (patch)
treebd7950d9d1dfc1771f5f07ec21ff39d0848a49c2 /BBSUtilities.c
parent055c1c18916113a130523e71002ef2d48f0f2ace (diff)
parent084ecb74f6007abbb7e1578675964ac9352ef822 (diff)
Merge branch 'upstream/latest' into debian/latest
Diffstat (limited to 'BBSUtilities.c')
-rw-r--r--BBSUtilities.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/BBSUtilities.c b/BBSUtilities.c
index 487b6a9..413a121 100644
--- a/BBSUtilities.c
+++ b/BBSUtilities.c
@@ -8061,6 +8061,14 @@ BOOL ProcessBBSConnectScript(CIRCUIT * conn, char * Buffer, int len)
now %= 86400;
Line = Scripts[n];
+ // Skip comments
+
+ while (Line && ((strcmp(Line, " ") == 0 || Line[0] == ';' || Line[0] == '#')))
+ {
+ n++;
+ Line = Scripts[n];
+ }
+
if (_memicmp(Line, "TIMES", 5) == 0)
{
NextBand:
@@ -9668,7 +9676,7 @@ VOID SaveConfig(char * ConfigName)
// Save UI config
- for (i=1; i<=32; i++)
+ for (i=1; i <= GetNumberofPorts(); i++)
{
char Key[100];
@@ -10192,7 +10200,7 @@ BOOL GetConfig(char * ConfigName)
GetStringValue(group, "Version", Size);
sscanf(Size,"%d,%d,%d,%d", &LastVer[0], &LastVer[1], &LastVer[2], &LastVer[3]);
- for (i=1; i<=32; i++)
+ for (i =1 ; i <= GetNumberofPorts(); i++)
{
char Key[100];
@@ -10654,7 +10662,8 @@ int Disconnected (int Stream)
}
/* ---- TAJ PG SERVER ---- */
- if ( conn->UserPointer->Temp->RUNPGPARAMS ) {
+ if (conn->UserPointer && conn->UserPointer->Temp && conn->UserPointer->Temp->RUNPGPARAMS)
+ {
printf("Freeing RUNPGPARAMS\n");
free(conn->UserPointer->Temp->RUNPGPARAMS);
conn->UserPointer->Temp->RUNPGPARAMS = NULL;
@@ -11870,7 +11879,7 @@ void run_pg( CIRCUIT * conn, struct UserInfo * user )
PROCESS_INFORMATION piProcInfo;
STARTUPINFO siStartInfo;
BOOL bSuccess = FALSE;
- DWORD dwRead, dwWritten;
+ DWORD dwRead;
CHAR chBuf[BUFSIZE];
int index = 0;
int ret = 0;
@@ -14526,7 +14535,7 @@ void ProcessSyncModeMessage(CIRCUIT * conn, struct UserInfo * user, char* Buffer
char * BIDptr;
BIDRec * BID;
- char *ptr1, *ptr2, *context;
+ char *ptr2, *context;
// TR AddMessage_1145_G8BPQ 727 1202 440 True
@@ -14762,8 +14771,6 @@ void SendRequestSync(CIRCUIT * conn)
char MsgTime[32];
time_t Time = time(NULL);
- char * Encoded;
-
tm = gmtime(&Time);
sprintf_s(Date, sizeof(Date), "%04d%02d%02d%02d%02d%02d",