New upstream version 6.0.24.66+repack

This commit is contained in:
Hibby 2025-03-04 22:46:52 +00:00
parent c858986248
commit b128f2a43a
31 changed files with 173 additions and 9120 deletions

View File

@ -1142,6 +1142,7 @@ int ProcessAGWCommand(struct AGWSocketConnectionInfo * sockptr)
int con,conport; int con,conport;
int AGWYReply = 0; int AGWYReply = 0;
int state, change; int state, change;
int n;
// if we have hidden some ports then the port in the AGW packet will be an index into the visible ports, // if we have hidden some ports then the port in the AGW packet will be an index into the visible ports,
// not the real port number // not the real port number
@ -1196,7 +1197,7 @@ int ProcessAGWCommand(struct AGWSocketConnectionInfo * sockptr)
conport=GetPortNumber(VisiblePortToRealPort[key[0]-48]); conport=GetPortNumber(VisiblePortToRealPort[key[0]-48]);
sprintf(ConnectMsg,"C %d %s",conport,ToCall); n = sprintf(ConnectMsg,"C %d %s",conport,ToCall);
// if 'v' command add digis // if 'v' command add digis
@ -1211,7 +1212,7 @@ int ProcessAGWCommand(struct AGWSocketConnectionInfo * sockptr)
while(nDigis--) while(nDigis--)
{ {
sprintf(ConnectMsg, "%s, %s", ConnectMsg, Digis); n += sprintf(&ConnectMsg[n], " %s", Digis);
Digis += 10; Digis += 10;
} }
} }

View File

@ -760,7 +760,7 @@ void SaveVesselDataBase()
void LoadNavAidDataBase() void LoadNavAidDataBase()
{ {
int i; int i, n, count;
FILE *file; FILE *file;
char buf[256]; char buf[256];
@ -793,10 +793,12 @@ void LoadNavAidDataBase()
NavRecords = (struct NAVAIDRECORD **)malloc(NavAidCount * sizeof(void *)); NavRecords = (struct NAVAIDRECORD **)malloc(NavAidCount * sizeof(void *));
count = 0;
for (i = 0; i < NavAidCount; i++) for (i = 0; i < NavAidCount; i++)
{ {
navptr = (struct NAVAIDRECORD *)malloc(sizeof(struct NAVAIDRECORD)); navptr = (struct NAVAIDRECORD *)malloc(sizeof(struct NAVAIDRECORD));
NavRecords[i] = navptr; NavRecords[count] = navptr;
memset(navptr, 0, sizeof(struct NAVAIDRECORD)); memset(navptr, 0, sizeof(struct NAVAIDRECORD));
fgets(buf, 255, file); fgets(buf, 255, file);
@ -807,6 +809,19 @@ void LoadNavAidDataBase()
token = strtok(NULL, "|\n" ); token = strtok(NULL, "|\n" );
strcpy(&navptr->name[0],token); strcpy(&navptr->name[0],token);
for (n = 0; n < 20; n++)
{
char c = navptr->name[n];
if (!isalpha(c) && !isdigit(c) && c != ' ' && c != '_')
{
count--;
break;
}
}
count++;
token = strtok(NULL, "|\n" ); token = strtok(NULL, "|\n" );
navptr->lat = atof(token); navptr->lat = atof(token);
@ -820,6 +835,7 @@ void LoadNavAidDataBase()
navptr->TimeLastUpdated = atoi(token); navptr->TimeLastUpdated = atoi(token);
} }
NavAidCount = count;
fclose(file); fclose(file);
} }

View File

@ -553,6 +553,8 @@ int APRSWriteLog(char * msg)
UCHAR Value[MAX_PATH]; UCHAR Value[MAX_PATH];
time_t T; time_t T;
struct tm * tm; struct tm * tm;
int n;
if (LogAPRSIS == 0) if (LogAPRSIS == 0)
return 0; return 0;
@ -574,8 +576,9 @@ int APRSWriteLog(char * msg)
strcat(Value, "logs/APRS_"); strcat(Value, "logs/APRS_");
} }
sprintf(Value, "%s%02d%02d%02d.log", Value, n = strlen(Value);
tm->tm_year - 100, tm->tm_mon+1, tm->tm_mday);
sprintf(&Value[n], "%02d%02d%02d.log", tm->tm_year - 100, tm->tm_mon+1, tm->tm_mday);
if ((file = fopen(Value, "ab")) == NULL) if ((file = fopen(Value, "ab")) == NULL)
return FALSE; return FALSE;

View File

@ -1494,7 +1494,10 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
if (_memicmp(&buff->L2DATA[0], "RADIO ", 6) == 0) if (_memicmp(&buff->L2DATA[0], "RADIO ", 6) == 0)
{ {
sprintf(&buff->L2DATA[0], "%d %s", TNC->Port, &buff->L2DATA[6]); char cmd[56];
strcpy(cmd, &buff->L2DATA[6]);
sprintf(&buff->L2DATA[0], "%d %s", TNC->Port, cmd);
if (Rig_Command(TNC->PortRecord->ATTACHEDSESSIONS[0]->L4CROSSLINK, &buff->L2DATA[0])) if (Rig_Command(TNC->PortRecord->ATTACHEDSESSIONS[0]->L4CROSSLINK, &buff->L2DATA[0]))
{ {
@ -5955,7 +5958,7 @@ VOID ARAXINIT(struct PORTCONTROL * PORT)
char Msg[80] = ""; char Msg[80] = "";
memcpy(Msg, PORT->PORTDESCRIPTION, 30); memcpy(Msg, PORT->PORTDESCRIPTION, 30);
sprintf(Msg, "%s\n", Msg); strcat(Msg, "\n);
WritetoConsoleLocal(Msg); WritetoConsoleLocal(Msg);
} }

View File

@ -5810,12 +5810,12 @@ VOID ProcessMsgLine(CIRCUIT * conn, struct UserInfo * user, char* Buffer, int ms
} }
else else
{ {
ToLen = sprintf(ToString, "%sTo: %s\r\n", ToString, Addr); ToLen = sprintf(&ToString[strlen(ToString)], "To: %s\r\n", Addr);
continue; continue;
} }
} }
ToLen = sprintf(ToString, "%sTo: %s@%s\r\n", ToString, Addr, Via); ToLen = sprintf(&ToString[strlen(ToString)], "To: %s@%s\r\n", Addr, Via);
continue; continue;
} }
@ -5833,7 +5833,7 @@ VOID ProcessMsgLine(CIRCUIT * conn, struct UserInfo * user, char* Buffer, int ms
} }
else else
{ {
ToLen = sprintf(ToString, "%sTo: %s\r\n", ToString, Addr); ToLen = sprintf(&ToString[strlen(ToString)], "To: %s\r\n", Addr);
// Add to B2 Message for RMS // Add to B2 Message for RMS

17
Bpq32.c
View File

@ -1253,6 +1253,9 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
// Fix problem using SENDRAW from BPQMail (63) // Fix problem using SENDRAW from BPQMail (63)
// Fix compatibility with latest ardopcf (64) // Fix compatibility with latest ardopcf (64)
// Fix bug in RHP socket timeout code (65) // Fix bug in RHP socket timeout code (65)
// Fix L4 RTT (66)
// Fix RigConrol with Chanxx but no other settings (66)
#define CKernel #define CKernel
@ -6117,13 +6120,14 @@ DllExport BOOL APIENTRY SaveReg(char * KeyIn, HANDLE hFile)
{ {
if (len > 76) if (len > 76)
{ {
len = sprintf(RegLine, "%s\\\r\n", RegLine); len += sprintf(&RegLine[len], "\\\r\n", RegLine);
strcat(RegLine, "\\\r\n");
WriteFile(hFile, RegLine, len, &written, NULL); WriteFile(hFile, RegLine, len, &written, NULL);
strcpy(RegLine, " "); strcpy(RegLine, " ");
len = 2; len = 2;
} }
len = sprintf(RegLine, "%s%02x,", RegLine, Value[k]); len += sprintf(&RegLine[len], "%02x,", Value[k]);
} }
RegLine[--len] = 0x0d; RegLine[--len] = 0x0d;
RegLine[++len] = 0x0a; RegLine[++len] = 0x0a;
@ -6149,19 +6153,20 @@ DllExport BOOL APIENTRY SaveReg(char * KeyIn, HANDLE hFile)
{ {
if (len > 76) if (len > 76)
{ {
len = sprintf(RegLine, "%s\\\r\n", RegLine); len += sprintf(RegLine[len], "\\\r\n");
WriteFile(hFile, RegLine, len, &written, NULL); WriteFile(hFile, RegLine, len, &written, NULL);
strcpy(RegLine, " "); strcpy(RegLine, " ");
len = 2; len = 2;
} }
len = sprintf(RegLine, "%s%02x,", RegLine, Value[k]);
len += sprintf(&RegLine[len], "%02x,", Value[k]);
if (len > 76) if (len > 76)
{ {
len = sprintf(RegLine, "%s\\\r\n", RegLine); len += sprintf(RegLine[len], "\\\r\n");
WriteFile(hFile, RegLine, len, &written, NULL); WriteFile(hFile, RegLine, len, &written, NULL);
strcpy(RegLine, " "); strcpy(RegLine, " ");
} }
len = sprintf(RegLine, "%s00,", RegLine); len += sprintf(&RegLine[len], "00,");
} }
RegLine[--len] = 0x0d; RegLine[--len] = 0x0d;

3
Cmd.c
View File

@ -1733,6 +1733,7 @@ VOID LISTENCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struc
char * ptr, *Context; char * ptr, *Context;
struct PORTCONTROL * PORT = NULL; struct PORTCONTROL * PORT = NULL;
char ListenPortList[128] = ""; char ListenPortList[128] = "";
int len = 0;
ptr = strtok_s(CmdTail, " ,", &Context); ptr = strtok_s(CmdTail, " ,", &Context);
@ -1785,7 +1786,7 @@ VOID LISTENCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struc
} }
} }
sprintf(ListenPortList, "%s %d", ListenPortList, Port); len += sprintf(&ListenPortList[len], " %d", Port);
ListenMask |= ((uint64_t)1 << (Port - 1)); ListenMask |= ((uint64_t)1 << (Port - 1));
} }

View File

@ -4792,6 +4792,7 @@ void GetPortCTEXT(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, st
struct stat STAT; struct stat STAT;
struct PORTCONTROL * PORT = PORTTABLE; struct PORTCONTROL * PORT = PORTTABLE;
char PortList[256] = ""; char PortList[256] = "";
int len = 0;
while (PORT) while (PORT)
{ {
@ -4833,7 +4834,7 @@ void GetPortCTEXT(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, st
*ptr = '\r'; *ptr = '\r';
sprintf(PortList, "%s,%d", PortList, PORT->PORTNUMBER); len += sprintf(&PortList[len], ",%d", PORT->PORTNUMBER);
} }
PORT = PORT->PORTPOINTER; PORT = PORT->PORTPOINTER;

View File

@ -538,7 +538,11 @@ pollloop:
if (_memicmp(&buff->L2DATA[0], "RADIO ", 6) == 0) if (_memicmp(&buff->L2DATA[0], "RADIO ", 6) == 0)
{ {
sprintf(&buff->L2DATA[0], "%d %s", TNC->Port, &buff->L2DATA[6]); char cmd[56];
strcpy(cmd, &buff->L2DATA[6]);
sprintf(&buff->L2DATA[0], "%d %s", TNC->Port, cmd);
if (Rig_Command(TNC->PortRecord->ATTACHEDSESSIONS[0]->L4CROSSLINK, &buff->L2DATA[0])) if (Rig_Command(TNC->PortRecord->ATTACHEDSESSIONS[0]->L4CROSSLINK, &buff->L2DATA[0]))
{ {

3860
FLDigi64.c

File diff suppressed because it is too large Load Diff

View File

@ -740,7 +740,10 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
if (_memicmp(&buff->L2DATA[0], "RADIO ", 6) == 0) if (_memicmp(&buff->L2DATA[0], "RADIO ", 6) == 0)
{ {
sprintf(&buff->L2DATA[0], "%d %s", TNC->Port, &buff->L2DATA[6]); char cmd[56];
strcpy(cmd, &buff->L2DATA[6]);
sprintf(&buff->L2DATA[0], "%d %s", TNC->Port, cmd);
if (Rig_Command(TNC->PortRecord->ATTACHEDSESSIONS[0]->L4CROSSLINK, &buff->L2DATA[0])) if (Rig_Command(TNC->PortRecord->ATTACHEDSESSIONS[0]->L4CROSSLINK, &buff->L2DATA[0]))
{ {
@ -4139,7 +4142,7 @@ void buildParamString(struct TNCINFO * TNC, char * line)
FDI->TuningRange * -1.0, FDI->TuningRange * 1.0, FDI->TXLevel); FDI->TuningRange * -1.0, FDI->TuningRange * 1.0, FDI->TXLevel);
if (FDI->hamlibHost) if (FDI->hamlibHost)
sprintf(line, "%s --rigctld_ip %s --rigctld_port %d", line, FDI->hamlibHost, FDI->hamlibPort); sprintf(&line[strlen(line)], " --rigctld_ip %s --rigctld_port %d", FDI->hamlibHost, FDI->hamlibPort);
if (FDI->LimitBandWidth) if (FDI->LimitBandWidth)
strcat(line, " --500hz"); strcat(line, " --500hz");

File diff suppressed because it is too large Load Diff

View File

@ -648,7 +648,11 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
if (_memicmp(&buff->L2DATA[0], "RADIO ", 6) == 0) if (_memicmp(&buff->L2DATA[0], "RADIO ", 6) == 0)
{ {
sprintf(&buff->L2DATA[0], "%d %s", TNC->Port, &buff->L2DATA[6]); char cmd[56];
strcpy(cmd, &buff->L2DATA[6]);
sprintf(&buff->L2DATA[0], "%d %s", TNC->Port, cmd);
if (Rig_Command(TNC->PortRecord->ATTACHEDSESSIONS[0]->L4CROSSLINK, &buff->L2DATA[0])) if (Rig_Command(TNC->PortRecord->ATTACHEDSESSIONS[0]->L4CROSSLINK, &buff->L2DATA[0]))
{ {

View File

@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
*/ */
//#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers //#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE
@ -4379,7 +4380,7 @@ int ProcessMailAPISignon(struct TCPINFO * TCP, char * MsgPtr, char * Appl, char
if (user && user[0] && password && password[0]) if (user && user[0] && password && password[0])
{ {
sprintf(MsgPtr, "%s?%s&%s", MsgPtr, user, password); sprintf(&MsgPtr[strlen(MsgPtr)], "?%s&%s", user, password);
} }
} }

View File

@ -1860,7 +1860,7 @@ static void cn_dec(ChatCIRCUIT *circuit, CHATNODE *node)
__try __try
{ {
#endif #endif
len = sprintf(line, "%s %p %s", line, cn->node, cn->node->alias); len += sprintf(&line[len], " %p %s", cn->node, cn->node->alias);
if (len > 80) if (len > 80)
{ {
Debugprintf("%s", line); Debugprintf("%s", line);
@ -2821,7 +2821,7 @@ static void show_circuits(ChatCIRCUIT *conn, char Flag)
CHATNODE *node; CHATNODE *node;
LINK *link; LINK *link;
char line[1000]; char line[1000];
int len; int len = 0;
CN *cn; CN *cn;
int i = 0; int i = 0;
@ -2836,16 +2836,16 @@ static void show_circuits(ChatCIRCUIT *conn, char Flag)
nprintf(conn, "%d Node(s)\r", i); nprintf(conn, "%d Node(s)\r", i);
if (Flag == 'c') if (Flag == 'c')
sprintf(line, "Here %-6.6s <-", OurNode); len = sprintf(line, "Here %-6.6s <-", OurNode);
else else
sprintf(line, "Here %-6.6s <-", OurAlias); len = sprintf(line, "Here %-6.6s <-", OurAlias);
for (node = node_hd; node; node = node->next) if (node->refcnt) for (node = node_hd; node; node = node->next) if (node->refcnt)
{ {
if (Flag == 'c') if (Flag == 'c')
len = sprintf(line, "%s %s", line, node->call); len += sprintf(&line[len], " %s", node->call);
else else
len = sprintf(line, "%s %s", line, node->alias); len += sprintf(&line[len], " %s", node->alias);
if (len > 80) if (len > 80)
{ {
nprintf(conn, "%s\r", line); nprintf(conn, "%s\r", line);
@ -2873,9 +2873,9 @@ static void show_circuits(ChatCIRCUIT *conn, char Flag)
__try __try
{ {
if (Flag == 'c') if (Flag == 'c')
len = sprintf(line, "%s %s", line, cn->node->call); len += sprintf(&line[len], " %s", cn->node->call);
else else
len = sprintf(line, "%s %s", line, cn->node->alias); len += sprintf(&line[len], " %s", cn->node->alias);
if (len > 80) if (len > 80)
{ {
nprintf(conn, "%s\r", line); nprintf(conn, "%s\r", line);
@ -2883,23 +2883,23 @@ static void show_circuits(ChatCIRCUIT *conn, char Flag)
} }
} }
__except(EXCEPTION_EXECUTE_HANDLER) __except(EXCEPTION_EXECUTE_HANDLER)
{len = sprintf(line, "%s *PE* Corrupt Rec %x %x", line, cn, cn->node);} {len += sprintf(&line[len], " *PE* Corrupt Rec %x %x", cn, cn->node);}
} }
else else
len = sprintf(line, "%s Corrupt Rec %x %x ", line, cn, cn->node); len = sprintf(&line[len], " Corrupt Rec %x %x ", cn, cn->node);
} }
} }
__except(EXCEPTION_EXECUTE_HANDLER) __except(EXCEPTION_EXECUTE_HANDLER)
{len = sprintf(line, "%s *PE* Corrupt Rec %x %x ", line, cn, cn->node);} {len += sprintf(&line[len], " *PE* Corrupt Rec %x %x ", cn, cn->node);}
#else #else
for (cn = circuit->hnode; cn; cn = cn->next) for (cn = circuit->hnode; cn; cn = cn->next)
{ {
if (cn->node && cn->node->alias) if (cn->node && cn->node->alias)
{ {
if (Flag == 'c') if (Flag == 'c')
len = sprintf(line, "%s %s", line, cn->node->call); len += sprintf(&line[len], " %s", cn->node->call);
else else
len = sprintf(line, "%s %s", line, cn->node->alias); len += sprintf(&line[len], " %s", cn->node->alias);
if (len > 80) if (len > 80)
{ {
nprintf(conn, "%s\r", line); nprintf(conn, "%s\r", line);
@ -2907,7 +2907,7 @@ static void show_circuits(ChatCIRCUIT *conn, char Flag)
} }
} }
else else
len = sprintf(line, "%s Corrupt Rec %p %p ", line, cn, cn->node); len += sprintf(&line[len], " Corrupt Rec %p %p ", cn, cn->node);
} }
#endif #endif
nprintf(conn, "%s\r", line); nprintf(conn, "%s\r", line);
@ -3682,7 +3682,7 @@ VOID SendChatLinkStatus()
} }
} }
len = sprintf(Msg, "%s%s %c ", Msg, link->call, '0' + link->flags); len += sprintf(&Msg[len], "%s %c ", link->call, '0' + link->flags);
if (len > 240) if (len > 240)
break; break;

View File

@ -458,7 +458,11 @@ ok:
if (_memicmp(txbuff, "RADIO ", 6) == 0) if (_memicmp(txbuff, "RADIO ", 6) == 0)
{ {
sprintf(&buff->L2DATA[0], "%d %s", TNC->Port, &txbuff[6]); char cmd[56];
strcpy(cmd, &buff->L2DATA[6]);
sprintf(&buff->L2DATA[0], "%d %s", TNC->Port, cmd);
if (Rig_Command(TNC->PortRecord->ATTACHEDSESSIONS[0]->L4CROSSLINK, &buff->L2DATA[0])) if (Rig_Command(TNC->PortRecord->ATTACHEDSESSIONS[0]->L4CROSSLINK, &buff->L2DATA[0]))
{ {

View File

@ -38,22 +38,22 @@ extern BPQVECSTRUC BPQHOSTVECTOR[];
#define BPQHOSTSTREAMS 64 #define BPQHOSTSTREAMS 64
#define IPHOSTVECTOR BPQHOSTVECTOR[BPQHOSTSTREAMS + 3] #define IPHOSTVECTOR BPQHOSTVECTOR[BPQHOSTSTREAMS + 3]
VOID CLOSECURRENTSESSION(TRANSPORTENTRY * Session); void CLOSECURRENTSESSION(TRANSPORTENTRY * Session);
VOID SENDL4DISC(TRANSPORTENTRY * Session); void SENDL4DISC(TRANSPORTENTRY * Session);
int C_Q_COUNT(VOID * Q); int C_Q_COUNT(void * Q);
TRANSPORTENTRY * SetupSessionForL2(struct _LINKTABLE * LINK); TRANSPORTENTRY * SetupSessionForL2(struct _LINKTABLE * LINK);
VOID InformPartner(struct _LINKTABLE * LINK, int Reason); void InformPartner(struct _LINKTABLE * LINK, int Reason);
VOID IFRM150(TRANSPORTENTRY * Session, PDATAMESSAGE Buffer); void IFRM150(TRANSPORTENTRY * Session, PDATAMESSAGE Buffer);
VOID SendConNAK(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG); void SendConNAK(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG);
BOOL FINDCIRCUIT(L3MESSAGEBUFFER * L3MSG, TRANSPORTENTRY ** REQL4, int * NewIndex); BOOL FINDCIRCUIT(L3MESSAGEBUFFER * L3MSG, TRANSPORTENTRY ** REQL4, int * NewIndex);
int GETBUSYBIT(TRANSPORTENTRY * L4); int GETBUSYBIT(TRANSPORTENTRY * L4);
BOOL cATTACHTOBBS(TRANSPORTENTRY * Session, UINT Mask, int Paclen, int * AnySessions); BOOL cATTACHTOBBS(TRANSPORTENTRY * Session, UINT Mask, int Paclen, int * AnySessions);
VOID SETUPNEWCIRCUIT(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG, VOID SETUPNEWCIRCUIT(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG,
TRANSPORTENTRY * L4, char * BPQPARAMS, int ApplMask, int * BPQNODE); TRANSPORTENTRY * L4, char * BPQPARAMS, int ApplMask, int * BPQNODE);
extern char * ALIASPTR; extern char * ALIASPTR;
VOID SendConACK(struct _LINKTABLE * LINK, TRANSPORTENTRY * L4, L3MESSAGEBUFFER * L3MSG, BOOL BPQNODE, UINT Applmask, UCHAR * ApplCall); void SendConACK(struct _LINKTABLE * LINK, TRANSPORTENTRY * L4, L3MESSAGEBUFFER * L3MSG, BOOL BPQNODE, UINT Applmask, UCHAR * ApplCall);
VOID L3SWAPADDRESSES(L3MESSAGEBUFFER * L3MSG); void L3SWAPADDRESSES(L3MESSAGEBUFFER * L3MSG);
VOID L4TIMEOUT(TRANSPORTENTRY * L4); void L4TIMEOUT(TRANSPORTENTRY * L4);
struct DEST_LIST * CHECKL3TABLES(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * Msg); struct DEST_LIST * CHECKL3TABLES(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * Msg);
int CHECKIFBUSYL4(TRANSPORTENTRY * L4); int CHECKIFBUSYL4(TRANSPORTENTRY * L4);
VOID AUTOTIMER(TRANSPORTENTRY * L4); VOID AUTOTIMER(TRANSPORTENTRY * L4);
@ -1776,7 +1776,7 @@ int FINDCIRCUIT(L3MESSAGEBUFFER * L3MSG, TRANSPORTENTRY ** REQL4, int * NewIndex
return FALSE; return FALSE;
} }
VOID L3SWAPADDRESSES(L3MESSAGEBUFFER * L3MSG) void L3SWAPADDRESSES(L3MESSAGEBUFFER * L3MSG)
{ {
// EXCHANGE ORIGIN AND DEST // EXCHANGE ORIGIN AND DEST
@ -1791,7 +1791,7 @@ VOID L3SWAPADDRESSES(L3MESSAGEBUFFER * L3MSG)
L3MSG->L3SRCE[6] |= 1; // Set Last Call L3MSG->L3SRCE[6] |= 1; // Set Last Call
} }
VOID SendConNAK(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG) void SendConNAK(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG)
{ {
L3MSG->L4FLAGS = L4CACK | L4BUSY; // REJECT L3MSG->L4FLAGS = L4CACK | L4BUSY; // REJECT
L3MSG->L4DATA[0] = 0; // WINDOW L3MSG->L4DATA[0] = 0; // WINDOW
@ -1965,7 +1965,7 @@ VOID FRAMEFORUS(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG, int ApplMask,
{ {
// INTERNODE LINK // INTERNODE LINK
TRANSPORTENTRY * L4 = 0; TRANSPORTENTRY * L4;
struct DEST_LIST * DEST; struct DEST_LIST * DEST;
int Opcode; int Opcode;
char Nodename[20]; char Nodename[20];
@ -2489,13 +2489,14 @@ VOID ACKFRAMES(L3MESSAGEBUFFER * L3MSG, TRANSPORTENTRY * L4, int NR)
RTT = GetTickCount() - L4->RTT_TIMER; RTT = GetTickCount() - L4->RTT_TIMER;
if (RTT < 180) // Sanity Check if (RTT < 180000) // Sanity Check
{ {
if (DEST->DEST_RTT == 0) if (DEST->DEST_RTT == 0)
DEST->DEST_RTT = RTT; DEST->DEST_RTT = RTT;
else else
DEST->DEST_RTT = ((DEST->DEST_RTT * 9) + RTT) /10; // 90% Old + New DEST->DEST_RTT = ((DEST->DEST_RTT * 9) + RTT) /10; // 90% Old + New
} }
L4->RTT_TIMER = 0;
} }
} }

View File

@ -407,7 +407,10 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
if (_memicmp(buff->L2DATA, "RADIO ", 6) == 0) if (_memicmp(buff->L2DATA, "RADIO ", 6) == 0)
{ {
sprintf(buff->L2DATA, "%d %s", TNC->Port, &buff->L2DATA[6]); char cmd[56];
strcpy(cmd, &buff->L2DATA[6]);
sprintf(buff->L2DATA, "%d %s", TNC->Port, cmd);
if (Rig_Command(TNC->PortRecord->ATTACHEDSESSIONS[0]->L4CROSSLINK, buff->L2DATA)) if (Rig_Command(TNC->PortRecord->ATTACHEDSESSIONS[0]->L4CROSSLINK, buff->L2DATA))
{ {
@ -1539,7 +1542,7 @@ VOID CloseComplete(struct TNCINFO * TNC, int Stream)
sprintf(Cmd, "%cDIGITAL MODE %s\x1b", '\x1a', TNC->MPSKInfo->DefaultMode); sprintf(Cmd, "%cDIGITAL MODE %s\x1b", '\x1a', TNC->MPSKInfo->DefaultMode);
if (TNC->MPSKInfo->Beacon) if (TNC->MPSKInfo->Beacon)
sprintf(Cmd, "%s%cBEACON_ARQ_FAE\x1b", Cmd, '\x1a'); sprintf(&Cmd[strlen(Cmd)], "%cBEACON_ARQ_FAE\x1b", '\x1a');
Len = strlen(Cmd); Len = strlen(Cmd);

File diff suppressed because it is too large Load Diff

View File

@ -1570,12 +1570,12 @@ VOID ProcessSMTPServerMessage(SocketConn * sockptr, char * Buffer, int Len)
if (CheckifLocalRMSUser(Addr)) // if local RMS - Leave Here if (CheckifLocalRMSUser(Addr)) // if local RMS - Leave Here
continue; continue;
ToLen = sprintf(ToString, "%sTo: %s\r\n", ToString, &Addr[4]); ToLen = sprintf(&ToString[strlen(ToString)], "To: %s\r\n", &Addr[4]);
*sockptr->RecpTo[i] = 0; // So we dont create individual one later *sockptr->RecpTo[i] = 0; // So we dont create individual one later
continue; continue;
} }
ToLen = sprintf(ToString, "%sTo: %s@%s\r\n", ToString, &Addr[4], Via); ToLen = sprintf(&ToString[strlen(ToString)], "To: %s@%s\r\n", &Addr[4], Via);
*sockptr->RecpTo[i] = 0; // So we dont create individual one later *sockptr->RecpTo[i] = 0; // So we dont create individual one later
continue; continue;
} }
@ -1591,7 +1591,7 @@ VOID ProcessSMTPServerMessage(SocketConn * sockptr, char * Buffer, int Len)
if (CheckifLocalRMSUser(Addr)) // if local RMS - Leave Here if (CheckifLocalRMSUser(Addr)) // if local RMS - Leave Here
continue; continue;
ToLen = sprintf(ToString, "%sTo: %s\r\n", ToString, Addr); ToLen = sprintf(&ToString[strlen(ToString)], "To: %s\r\n", Addr);
*sockptr->RecpTo[i] = 0; // So we dont create individual one later *sockptr->RecpTo[i] = 0; // So we dont create individual one later
continue; continue;

View File

@ -5286,10 +5286,13 @@ BOOL DecodeModePtr(char * Param, double * Dwell, double * Freq, char * Mode,
ptr = strtok_s(NULL, ",", &Context); ptr = strtok_s(NULL, ",", &Context);
if (ptr == NULL || strlen(ptr) > 8) if (ptr == NULL)
return FALSE; if (*MemoryNumber) // If channel, dont need mode
return TRUE;
if (ptr == NULL || strlen(ptr) > 8)
return FALSE; // Mode Missing
// If channel, dont need mode
if (*MemoryNumber == 0) if (*MemoryNumber == 0)
{ {
@ -7393,6 +7396,8 @@ VOID SetupScanInterLockGroups(struct RIGINFO *RIG)
int Interlock = RIG->Interlock; int Interlock = RIG->Interlock;
char PortString[128] = ""; char PortString[128] = "";
char TxPortString[128] = ""; char TxPortString[128] = "";
int n = 0;
int nn = 0;
// Find TNC ports in this Rig's scan group // Find TNC ports in this Rig's scan group
@ -7409,7 +7414,7 @@ VOID SetupScanInterLockGroups(struct RIGINFO *RIG)
{ {
int p = PortRecord->PORTNUMBER; int p = PortRecord->PORTNUMBER;
RIG->BPQPort |= ((uint64_t)1 << p); RIG->BPQPort |= ((uint64_t)1 << p);
sprintf(PortString, "%s,%d", PortString, p); n += sprintf(&PortString[n], ",%d", p);
TNC->RIG = RIG; TNC->RIG = RIG;
if (RIG->PTTMode == 0 && TNC->PTTMode) if (RIG->PTTMode == 0 && TNC->PTTMode)
@ -7419,7 +7424,7 @@ VOID SetupScanInterLockGroups(struct RIGINFO *RIG)
{ {
int p = PortRecord->PORTNUMBER; int p = PortRecord->PORTNUMBER;
RIG->BPQPort |= ((uint64_t)1 << p); RIG->BPQPort |= ((uint64_t)1 << p);
sprintf(TxPortString, "%s,%d", TxPortString, p); nn += sprintf(&TxPortString[nn], ",%d", p);
TNC->TXRIG = RIG; TNC->TXRIG = RIG;
if (RIG->PTTMode == 0 && TNC->PTTMode) if (RIG->PTTMode == 0 && TNC->PTTMode)

File diff suppressed because it is too large Load Diff

View File

@ -508,7 +508,10 @@ ok:
if (_memicmp(&buff->L2DATA[0], "RADIO ", 6) == 0) if (_memicmp(&buff->L2DATA[0], "RADIO ", 6) == 0)
{ {
sprintf(&buff->L2DATA[0], "%d %s", TNC->Port, &buff->L2DATA[6]); char cmd[56];
strcpy(cmd, &buff->L2DATA[6]);
sprintf(&buff->L2DATA[0], "%d %s", TNC->Port, cnd);
if (Rig_Command(TNC->PortRecord->ATTACHEDSESSIONS[0]->L4CROSSLINK, &buff->L2DATA[0])) if (Rig_Command(TNC->PortRecord->ATTACHEDSESSIONS[0]->L4CROSSLINK, &buff->L2DATA[0]))
{ {

View File

@ -4501,7 +4501,7 @@ MsgLoop:
WritetoTrace(Stream, MsgPtr, InputLen, sockptr->ADIF, 'R'); WritetoTrace(Stream, MsgPtr, InputLen, sockptr->ADIF, 'R');
} }
if (InputLen == 8 && memcmp(MsgPtr, ";;;\r\n", 8) == 0) if (InputLen == 8 && memcmp(MsgPtr, ";;;;;;\r\n", 8) == 0)
{ {
// CMS Keepalive // CMS Keepalive
@ -5146,7 +5146,13 @@ int DataSocket_ReadHTTP(struct TNCINFO * TNC, struct ConnectionInfo * sockptr, S
} }
} }
else else
{
Debugprintf("WebSock Opcode %d Msg %s", Opcode, &MsgPtr[6]); Debugprintf("WebSock Opcode %d Msg %s", Opcode, &MsgPtr[6]);
closesocket(sockptr->socket);
sockptr->SocketActive = FALSE;
ShowConnections(TNC);
}
sockptr->InputLen = 0; sockptr->InputLen = 0;
return 0; return 0;
@ -5467,8 +5473,7 @@ int WriteLog(char * msg)
strcat(Value, "logs/Telnet_"); strcat(Value, "logs/Telnet_");
} }
sprintf(Value, "%s%02d%02d%02d.log", Value, sprintf(&Value[strlen(Value)], "%02d%02d%02d.log", tm->tm_year - 100, tm->tm_mon+1, tm->tm_mday);
tm->tm_year - 100, tm->tm_mon+1, tm->tm_mday);
if ((file = fopen(Value, "a")) == NULL) if ((file = fopen(Value, "a")) == NULL)
return FALSE; return FALSE;
@ -5523,8 +5528,7 @@ VOID WriteCMSLog(char * msg)
strcat(Value, "logs/CMSAccess"); strcat(Value, "logs/CMSAccess");
} }
sprintf(Value, "%s_%04d%02d%02d.log", Value, sprintf(&Value[strlen(Value)], "_%04d%02d%02d.log", tm->tm_year +1900, tm->tm_mon+1, tm->tm_mday);
tm->tm_year +1900, tm->tm_mon+1, tm->tm_mday);
Handle = fopen(Value, "ab"); Handle = fopen(Value, "ab");

View File

@ -1023,7 +1023,11 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
if (_memicmp(&buff->L2DATA[0], "RADIO ", 6) == 0) if (_memicmp(&buff->L2DATA[0], "RADIO ", 6) == 0)
{ {
sprintf(&buff->L2DATA[0], "%d %s", TNC->Port, &buff->L2DATA[6]); char cmd[56];
strcpy(cmd, &buff->L2DATA[6]);
sprintf(&buff->L2DATA[0], "%d %s", TNC->Port, cmd);
if (Rig_Command(TNC->PortRecord->ATTACHEDSESSIONS[0]->L4CROSSLINK, &buff->L2DATA[0])) if (Rig_Command(TNC->PortRecord->ATTACHEDSESSIONS[0]->L4CROSSLINK, &buff->L2DATA[0]))
{ {

5
V4.c
View File

@ -622,7 +622,10 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
if (_memicmp(buff->L2DATA, "RADIO ", 6) == 0) if (_memicmp(buff->L2DATA, "RADIO ", 6) == 0)
{ {
sprintf(buff->L2DATA, "%d %s", TNC->Port, &buff->L2DATA[6]); char cmd[56];
strcpy(cmd, &buff->L2DATA[6]);
sprintf(buff->L2DATA, "%d %s", TNC->Port, cmd);
if (Rig_Command(TNC->PortRecord->ATTACHEDSESSIONS[0]->L4CROSSLINK, buff->L2DATA)) if (Rig_Command(TNC->PortRecord->ATTACHEDSESSIONS[0]->L4CROSSLINK, buff->L2DATA))
{ {

View File

@ -10,8 +10,8 @@
#endif #endif
#define KVers 6,0,24,65 #define KVers 6,0,24,66
#define KVerstring "6.0.24.65\0" #define KVerstring "6.0.24.66\0"
#ifdef CKernel #ifdef CKernel

View File

@ -984,7 +984,11 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
if (_memicmp(&buff->L2DATA[0], "RADIO ", 6) == 0) if (_memicmp(&buff->L2DATA[0], "RADIO ", 6) == 0)
{ {
sprintf(&buff->L2DATA[0], "%d %s", TNC->Port, &buff->L2DATA[6]); char cmd[56];
strcpy(cmd, &buff->L2DATA[6]);
sprintf(&buff->L2DATA[0], "%d %s", TNC->Port, &cmd);
if (Rig_Command(TNC->PortRecord->ATTACHEDSESSIONS[0]->L4CROSSLINK, &buff->L2DATA[0])) if (Rig_Command(TNC->PortRecord->ATTACHEDSESSIONS[0]->L4CROSSLINK, &buff->L2DATA[0]))
{ {

View File

@ -2293,6 +2293,7 @@ void ProcessWebMailMessage(struct HTTPConnectionInfo * Session, char * Key, BOOL
struct HtmlFormDir * Dir; struct HtmlFormDir * Dir;
int i; int i;
int len;
SubDir = strlop(&NodeURL[17], ':'); SubDir = strlop(&NodeURL[17], ':');
DirNo = atoi(&NodeURL[17]); DirNo = atoi(&NodeURL[17]);
@ -2313,9 +2314,9 @@ void ProcessWebMailMessage(struct HTTPConnectionInfo * Session, char * Key, BOOL
Dir = HtmlFormDirs[DirNo]; Dir = HtmlFormDirs[DirNo];
if (SubDir) if (SubDir)
sprintf(popup, popuphddr, Key, Dir->Dirs[SubDirNo]->DirName); len = sprintf(popup, popuphddr, Key, Dir->Dirs[SubDirNo]->DirName);
else else
sprintf(popup, popuphddr, Key, Dir->DirName); len = sprintf(popup, popuphddr, Key, Dir->DirName);
if (SubDir) if (SubDir)
{ {
@ -2326,7 +2327,7 @@ void ProcessWebMailMessage(struct HTTPConnectionInfo * Session, char * Key, BOOL
// We only send if there is a .txt file // We only send if there is a .txt file
if (_stricmp(&Name[strlen(Name) - 4], ".txt") == 0) if (_stricmp(&Name[strlen(Name) - 4], ".txt") == 0)
sprintf(popup, "%s <option value=%d:%d,%d>%s", popup, DirNo, SubDirNo, i, Name); len += sprintf(&popup[len], " <option value=%d:%d,%d>%s", DirNo, SubDirNo, i, Name);
} }
} }
else else
@ -2338,10 +2339,10 @@ void ProcessWebMailMessage(struct HTTPConnectionInfo * Session, char * Key, BOOL
// We only send if there is a .txt file // We only send if there is a .txt file
if (_stricmp(&Name[strlen(Name) - 4], ".txt") == 0) if (_stricmp(&Name[strlen(Name) - 4], ".txt") == 0)
sprintf(popup, "%s <option value=%d,%d>%s", popup, DirNo, i, Name); len += sprintf(&popup[len], " <option value=%d,%d>%s", DirNo, i, Name);
} }
} }
sprintf(popup, "%s</select></p>", popup); len += sprintf(&popup[len], "</select></p>");
*RLen = sprintf(Reply, "%s", popup); *RLen = sprintf(Reply, "%s", popup);
return; return;
@ -2409,6 +2410,7 @@ VOID SendTemplateSelectScreen(struct HTTPConnectionInfo * Session, char *Params,
int i; int i;
int MsgLen = 0; int MsgLen = 0;
char * Boundary; char * Boundary;
int len;
WebMailInfo * WebMail = Session->WebMail; WebMailInfo * WebMail = Session->WebMail;
@ -2455,7 +2457,7 @@ VOID SendTemplateSelectScreen(struct HTTPConnectionInfo * Session, char *Params,
// Also to active fields in case not changed by form // Also to active fields in case not changed by form
sprintf(popup, popuphddr, Session->Key); len = sprintf(popup, popuphddr, Session->Key);
LastGroup = HtmlFormDirs[0]->FormSet; // Save so we know when changes LastGroup = HtmlFormDirs[0]->FormSet; // Save so we know when changes
@ -2468,21 +2470,21 @@ VOID SendTemplateSelectScreen(struct HTTPConnectionInfo * Session, char *Params,
if (strcmp(LastGroup, Dir->FormSet) != 0) if (strcmp(LastGroup, Dir->FormSet) != 0)
{ {
LastGroup = Dir->FormSet; LastGroup = Dir->FormSet;
sprintf(popup, "%s%s", popup, NewGroup); len += sprintf(&popup[len], "%s", NewGroup);
} }
sprintf(popup, "%s <option value=%d>%s", popup, i, Dir->DirName); len += sprintf(&popup[len], " <option value=%d>%s", i, Dir->DirName);
// Recurse any Subdirs // Recurse any Subdirs
n = 0; n = 0;
while (n < Dir->DirCount) while (n < Dir->DirCount)
{ {
sprintf(popup, "%s <option value=%d:%d>%s", popup, i, n, Dir->Dirs[n]->DirName); len += sprintf(&popup[len], " <option value=%d:%d>%s", i, n, Dir->Dirs[n]->DirName);
n++; n++;
} }
} }
sprintf(popup, "%s</select></td></tr></table></p>", popup); len += sprintf(&popup[len], "%</select></td></tr></table></p>");
*WebMail->RLen = sprintf(WebMail->Reply, "%s", popup); *WebMail->RLen = sprintf(WebMail->Reply, "%s", popup);
@ -5495,6 +5497,7 @@ BOOL DoSelectPrompt(struct HTTPConnectionInfo * Session, char * Select)
char * ptr, * ptr1; char * ptr, * ptr1;
char * prompt; char * prompt;
char * var[100]; char * var[100];
int len;
WebMailInfo * WebMail = Session->WebMail; WebMailInfo * WebMail = Session->WebMail;
@ -5564,7 +5567,7 @@ BOOL DoSelectPrompt(struct HTTPConnectionInfo * Session, char * Select)
ptr = ptr1; ptr = ptr1;
} }
sprintf(popup, popuphddr, Session->Key, prompt, vars + 1); len = sprintf(popup, popuphddr, Session->Key, prompt, vars + 1);
for (i = 0; i < vars; i++) for (i = 0; i < vars; i++)
{ {
@ -5573,9 +5576,9 @@ BOOL DoSelectPrompt(struct HTTPConnectionInfo * Session, char * Select)
if (key == NULL) if (key == NULL)
key = var[i]; key = var[i];
sprintf(popup, "%s <option value='%s'>%s", popup, key, var[i]); len += sprintf(&popup[len], " <option value='%s'>%s", key, var[i]);
} }
sprintf(popup, "%s</select></td></tr></table><br><input onclick=window.history.back() value=Back type=button class='btn'></div>", popup); len += sprintf(&popup[len], "%s</select></td></tr></table><br><input onclick=window.history.back() value=Back type=button class='btn'></div>");
*WebMail->RLen = sprintf(WebMail->Reply, "%s", popup); *WebMail->RLen = sprintf(WebMail->Reply, "%s", popup);
free(SelCopy); free(SelCopy);
@ -6134,16 +6137,17 @@ VOID getAttachmentList(struct HTTPConnectionInfo * Session, char * Reply, int *
char popup[10000]; char popup[10000];
int i; int i;
WebMailInfo * WebMail = Session->WebMail; WebMailInfo * WebMail = Session->WebMail;
int len;
sprintf(popup, popuphddr, Session->Key, WebMail->Files); len = sprintf(popup, popuphddr, Session->Key, WebMail->Files);
for (i = 0; i < WebMail->Files; i++) for (i = 0; i < WebMail->Files; i++)
{ {
if(WebMail->FileLen[i] < 100000) if(WebMail->FileLen[i] < 100000)
sprintf(popup, "%s <option value=%d>%s (Len %d)", popup, i + 1, WebMail->FileName[i], WebMail->FileLen[i]); len += sprintf(&popup[len], " <option value=%d>%s (Len %d)", i + 1, WebMail->FileName[i], WebMail->FileLen[i]);
} }
sprintf(popup, "%s</select></td></tr></table><br><input onclick=window.history.back() value=Back type=button class='btn'></div>", popup); len += sprintf(&popup[len], "%</select></td></tr></table><br><input onclick=window.history.back() value=Back type=button class='btn'></div>");
*RLen = sprintf(Reply, "%s", popup); *RLen = sprintf(Reply, "%s", popup);
return; return;
@ -6289,7 +6293,7 @@ int ProcessWebmailWebSock(char * MsgPtr, char * OutBuffer)
} }
} }
ptr += sprintf(ptr, "%s</pre> \r\n", ptr); ptr += sprintf(&ptr[strlen(ptr)], "</pre> \r\n");
Len = ptr - &OutBuffer[10]; Len = ptr - &OutBuffer[10];

3
adif.c
View File

@ -409,8 +409,7 @@ BOOL WriteADIFRecord(ADIF * ADIF)
strcat(Value, "logs/BPQ_CMS_ADIF"); strcat(Value, "logs/BPQ_CMS_ADIF");
} }
sprintf(Value, "%s_%04d%02d.adi", Value, sprintf(&Value[strlen(Value)], "_%04d%02d.adi", tm->tm_year +1900, tm->tm_mon+1);
tm->tm_year +1900, tm->tm_mon+1);
STAT.st_size = 0; STAT.st_size = 0;
stat(Value, &STAT); stat(Value, &STAT);

View File

@ -2,6 +2,7 @@
// Authentication is via Telnet USER records. // Authentication is via Telnet USER records.
#define _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE
#include "cheaders.h" #include "cheaders.h"
@ -335,7 +336,7 @@ Token * find_token(const char* token)
int send_http_response(char * response, const char* msg) int send_http_response(char * response, const char* msg)
{ {
return sprintf(response, "HTTP/1.1 %s\r\nContent-Length: 0\r\nConnection: close\r\n\r\n", msg); return sprintf(response, "HTTP/1.1 %s\r\nAccess-Control-Allow-Origin: *\r\nContent-Length: 0\r\nConnection: close\r\n\r\n", msg);
} }
/* /*