diff --git a/AEAPactor.c b/AEAPactor.c index 98ca400..643dae1 100644 --- a/AEAPactor.c +++ b/AEAPactor.c @@ -292,8 +292,7 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff) { // Send Error Response - buffptr->Len = 36; - memcpy(buffptr->Data, "No Connection to PACTOR TNC\r", 36); + buffptr->Len = sprintf(buffptr->Data, "No Connection to PACTOR TNC\r"); C_Q_ADD(&TNC->Streams[Stream].PACTORtoBPQ_Q, buffptr); diff --git a/BPQMail.c b/BPQMail.c index 70061d7..4291daf 100644 --- a/BPQMail.c +++ b/BPQMail.c @@ -3396,7 +3396,6 @@ BOOL Initialise() CreatePipeThread(); GetPGConfig(); - APIClock = 0; return TRUE; diff --git a/Bpq32.c b/Bpq32.c index e51f9d0..9589351 100644 --- a/Bpq32.c +++ b/Bpq32.c @@ -1236,6 +1236,8 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses // AGWAPI Add protection against accidental connects from a non-agw application (50) // Save MH and NODES every hour (51) // Fix handling long unix device names (now max 250 bytes) (52) +// Fix error reporting in api update (53) +// Coding changes to remove some compiler warnings (53) #define CKernel diff --git a/CommonCode.c b/CommonCode.c index e3504d1..bfcc8a2 100644 --- a/CommonCode.c +++ b/CommonCode.c @@ -5040,8 +5040,6 @@ DllExport VOID WINAPI SendWebRequest(char * Host, char * Request, char * Params, else { strlop(Buffer, 13); - Debugprintf("Map Update Params - %s", Params); - Debugprintf("Map Update failed - %s", Buffer); } closesocket(sock); diff --git a/DRATS.c b/DRATS.c index 2615ce6..73baaef 100644 --- a/DRATS.c +++ b/DRATS.c @@ -168,7 +168,7 @@ int AllocateDRATSStream(struct DRATSSession * Sess) if (Stream == 255) return 0; - if (memcmp(Sess->CallTo, "NODE", 6) == 0) + if (memcmp(Sess->CallTo, "NODE", 4) == 0) { // Just connect to command level on switch } diff --git a/FLDigi.c b/FLDigi.c index 95c8019..0e6711c 100644 --- a/FLDigi.c +++ b/FLDigi.c @@ -93,6 +93,7 @@ VOID CheckFLDigiData(struct TNCINFO * TNC); VOID SendPacket(struct TNCINFO * TNC, UCHAR * Msg, int MsgLen); int KissEncode(UCHAR * inbuff, UCHAR * outbuff, int len); VOID SendXMLCommand(struct TNCINFO * TNC, char * Command, char * Value, char ParamType); +VOID SendXMLCommandInt(struct TNCINFO * TNC, char * Command, int Value, char ParamType); VOID FLSlowTimer(struct TNCINFO * TNC); VOID SendKISSCommand(struct TNCINFO * TNC, char * Msg); @@ -592,7 +593,7 @@ pollloop: } else { - SendXMLCommand(TNC, "modem.set_carrier", (char *)atoi(&buff->L2DATA[5]), 'I'); + SendXMLCommandInt(TNC, "modem.set_carrier", atoi(&buff->L2DATA[5]), 'I'); } TNC->InternalCmd = TRUE; @@ -3197,7 +3198,7 @@ VOID FLReleaseTNC(struct TNCINFO * TNC) else { SendXMLCommand(TNC, "modem.set_by_name", TNC->FLInfo->DefaultMode, 'S'); - SendXMLCommand(TNC, "modem.set_carrier", (char *)TNC->FLInfo->DefaultFreq, 'I'); + SendXMLCommandInt(TNC, "modem.set_carrier", TNC->FLInfo->DefaultFreq, 'I'); } } // Start Scanner @@ -3895,6 +3896,27 @@ VOID SendXMLCommand(struct TNCINFO * TNC, char * Command, char * Value, char Par return; } +VOID SendXMLCommandInt(struct TNCINFO * TNC, char * Command, int Value, char ParamType) +{ + int Len; + char ReqBuf[512]; + char SendBuff[512]; + struct FLINFO * FL = TNC->FLInfo; + struct ARQINFO * ARQ = TNC->ARQInfo; + char ValueString[256] =""; + + if (!TNC->CONNECTED || TNC->FLInfo->KISSMODE) + return; + + sprintf(ValueString, "%d", Value); + + strcpy(FL->LastXML, Command); + Len = sprintf(ReqBuf, Req, FL->LastXML, ValueString); + Len = sprintf(SendBuff, MsgHddr, Len, ReqBuf); + send(TNC->TCPSock, SendBuff, Len, 0); + return; +} + VOID SendXMLPoll(struct TNCINFO * TNC) { int Len; diff --git a/Multicast.c b/Multicast.c index 8283d3f..ba5dcb5 100644 --- a/Multicast.c +++ b/Multicast.c @@ -612,16 +612,16 @@ struct MSESSION * FindMSession(unsigned int Key) #define LZMA_STR "\1LZMA" -UCHAR * LZUncompress(UCHAR * Decoded, int Len, int * NewLen) +UCHAR * LZUncompress(UCHAR * Decoded, size_t Len, size_t * NewLen) { unsigned char * buf; unsigned char inprops[LZMA_PROPS_SIZE]; size_t inlen; int r; - UINT rlen; - UINT outlen; - + size_t rlen = 0; + size_t outlen; + memcpy(&rlen, &Decoded[5], 4); outlen = ntohl(rlen); @@ -668,8 +668,8 @@ void SaveMulticastMessage(struct MSESSION * MSession) { UCHAR * Decoded = NULL; // Output from Basexxx decode UCHAR * Uncompressed = NULL; - int DecodedLen; // Length of decoded message - int UncompressedLen; // Length of decompressed message + size_t DecodedLen; // Length of decoded message + size_t UncompressedLen; // Length of decompressed message int ExpectedLen; // From front of Base128 or Base256 message int HddrLen; // Length of Expected Len Header diff --git a/Versions.h b/Versions.h index 97116cb..b50ccd4 100644 --- a/Versions.h +++ b/Versions.h @@ -10,14 +10,14 @@ #endif -#define KVers 6,0,24,52 -#define KVerstring "6.0.24.52\0" +#define KVers 6,0,24,53 +#define KVerstring "6.0.24.53\0" #ifdef CKernel #define Vers KVers #define Verstring KVerstring -#define Datestring "November 2024" +#define Datestring "December 2024" #define VerComments "G8BPQ Packet Switch (C Version)" KVerstring #define VerCopyright "Copyright © 2001-2024 John Wiseman G8BPQ\0" #define VerDesc "BPQ32 Switch\0" diff --git a/WPRoutines.c b/WPRoutines.c index 4a065b5..da46799 100644 --- a/WPRoutines.c +++ b/WPRoutines.c @@ -1416,7 +1416,7 @@ int CreateWPMessage() // if (ptr->last_modif > LASTWPSendTime && ptr->Type == 'U' && ptr->first_homebbs[0]) if (ptr->changed && ptr->last_modif > LASTWPSendTime && ptr->first_homebbs[0]) { - tm = gmtime(&ptr->last_modif); + tm = gmtime((time_t *)&ptr->last_modif); MsgLen += sprintf(Buffptr, "On %02d%02d%02d %s/%c @ %s zip %s %s %s\r\n", tm->tm_year-100, tm->tm_mon+1, tm->tm_mday, ptr->callsign, ptr->Type, ptr->first_homebbs, @@ -1533,8 +1533,8 @@ VOID CreateWPReport() len = sprintf(Line, "%-7s,%c,%s,%s,%s,%s,%s,%s,%s,%d,%s,%s\r\n", WP->callsign, WP->Type, WP->first_homebbs, WP->first_qth, WP->first_zip, WP->secnd_homebbs, WP->secnd_qth, WP->secnd_zip, WP->name, WP->changed, - FormatWPDate(WP->last_modif), - FormatWPDate(WP->last_seen)); + FormatWPDate((time_t)WP->last_modif), + FormatWPDate((time_t)WP->last_seen)); fwrite(Line, 1, len, hFile); } diff --git a/bpqmail.h b/bpqmail.h index 78a1831..956d7d6 100644 --- a/bpqmail.h +++ b/bpqmail.h @@ -643,9 +643,9 @@ struct MsgInfo // For 64 bit time_t compatibility define as long long // (so struct is same with 32 or 64 bit time_t) - long long datereceived; - long long datecreated; - long long datechanged; + int64_t datereceived; + int64_t datecreated; + int64_t datechanged; char Spare[61 - 24]; // For future use } ; diff --git a/cMain.c b/cMain.c index 4f9dc9b..0238d3b 100644 --- a/cMain.c +++ b/cMain.c @@ -912,7 +912,7 @@ BOOL Start() PORT->PROTOCOL = (char)PortRec->PROTOCOL; PORT->IOBASE = PortRec->IOADDR; - if (PortRec->SerialPortName[0]) + if (PortRec->SerialPortName && PortRec->SerialPortName[0]) PORT->SerialPortName = _strdup(PortRec->SerialPortName); else { diff --git a/config.c b/config.c index 1c549b7..3220b87 100644 --- a/config.c +++ b/config.c @@ -2424,7 +2424,7 @@ int doSerialPortName(int i, char * value, char * rec) if (IsNumeric(rec)) xxp.IOADDR = atoi(rec); else - strcpy(xxp.SerialPortName, rec); + xxp.SerialPortName = strdup(rec); return 1; } diff --git a/configstructs.h b/configstructs.h index ef6f23b..831456d 100644 --- a/configstructs.h +++ b/configstructs.h @@ -67,7 +67,7 @@ struct PORTCONFIG char Pad2[10]; // 246 char VALIDCALLS[256]; // 256 - 512 struct WL2KInfo * WL2K; // 512 - char SerialPortName[80]; // 516 + char * SerialPortName; // 516 struct XDIGI * XDIGIS; // 596 Cross port digi setup int RIGPORT; // Linked port with RigControl unsigned int PERMITTEDAPPLS; // Appls allowed on this port diff --git a/mailapi.c b/mailapi.c index c1f60d8..cb0f223 100644 --- a/mailapi.c +++ b/mailapi.c @@ -869,7 +869,6 @@ double LonFromLOC = 0; void SendBBSDataToPktMap() { - char Return[4096]; char Request[64]; char * Params; char * ptr; @@ -967,7 +966,7 @@ void SendBBSDataToPktMap() CheckifRoutable(Msg); - tm = gmtime(&Msg->datereceived); + tm = gmtime((time_t *)&Msg->datereceived); sprintf(Time, "%04d-%02d-%02dT%02d:%02d:%02d+00:00", tm->tm_year + 1900, tm->tm_mon+1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); @@ -1101,7 +1100,7 @@ int unroutableCount = 0; ptr += sprintf(ptr, "\"location\": \"%s\",\r\n", ourBBSRec->Address); ptr += sprintf(ptr, "\"unroutable\": %s\r\n}\r\n", Unroutables); - SendWebRequest("packetnodes.spots.radio", Request, Params, Return); + SendWebRequest("packetnodes.spots.radio", Request, Params, 0); free(Messages); free(Unroutables); free(Params);