diff --git a/kermit/dialer/kconnect.cpp b/kermit/dialer/kconnect.cpp index 84c981f3..45e0ca42 100644 --- a/kermit/dialer/kconnect.cpp +++ b/kermit/dialer/kconnect.cpp @@ -287,7 +287,7 @@ kcopy(char *source, char *destination) { x = strlen(destination); len = strlen(destination) + strlen(source) + 2; - if (!(p = (char *)malloc(len))) + if ((p = (char *)malloc(len)) == NULL) return(-1); strcpy(p,destination); /* Directory part */ if (!ISDIRSEP(*(destination+x-1))) /* Separator, if needed */ @@ -296,7 +296,7 @@ kcopy(char *source, char *destination) { strcat(p,q); /* Concatenate to new directory */ } else { len = strlen(destination) + 64; - if (!(p = (char *)malloc(len))) + if ((p = (char *)malloc(len)) == NULL) return(-1); strcpy(p,destination); } @@ -332,7 +332,7 @@ kmkdir(const char *path) { x = strlen(path); if (x < 1 || x > CKMAXPATH) /* Check length */ return(-1); - if (!(tp = (char *)malloc(x+1))) /* Make a temporary copy */ + if ((tp = (char *)malloc(x+1)) == NULL) /* Make a temporary copy */ return(-1); strcpy(tp,path); @@ -735,7 +735,7 @@ K_CONNECTOR::K_CONNECTOR(void) if ( !isdir(dir) ) { kmkdir(dir); - if ( common = GetAppData(1) ) { + if ( (common = GetAppData(1)) != NULL ) { sprintf(file,"%s%s",(char *)common, "Kermit 95\\K95CUSTOM.INI"); kcopy(file,dir); appdata = GetAppData(0); @@ -7227,7 +7227,7 @@ StartKermit( KD_LIST_ITEM * entry, KD_CONFIG * config, KD_LIST_ITEM * def_entry } if (!StartKermitFileName && - !(StartKermitFileName = (ZIL_ICHAR *) new ZIL_ICHAR[BUFFERSIZE])) { + (StartKermitFileName = (ZIL_ICHAR *) new ZIL_ICHAR[BUFFERSIZE]) == NULL) { if ( !StartKermitFileName ) OutofMemory("Unable to create MESSAGE_WINDOW StartKermit 3"); @@ -8403,7 +8403,7 @@ ExportLocations(void) } if (!StartKermitFileName && - !(StartKermitFileName = (ZIL_ICHAR *) new ZIL_ICHAR[BUFFERSIZE])) { + (StartKermitFileName = (ZIL_ICHAR *) new ZIL_ICHAR[BUFFERSIZE]) == NULL) { if ( !StartKermitFileName ) OutofMemory("Unable to create ICHAR ExportLocations 1"); @@ -8511,7 +8511,7 @@ ExportModems(void) } if (!StartKermitFileName && - !(StartKermitFileName = (ZIL_ICHAR *) new ZIL_ICHAR[BUFFERSIZE])) { + (StartKermitFileName = (ZIL_ICHAR *) new ZIL_ICHAR[BUFFERSIZE]) == NULL) { if ( !StartKermitFileName ) OutofMemory("Unable to create ICHAR ExportModems"); #ifdef WIN32 @@ -8669,7 +8669,7 @@ CreateShortcut( KD_LIST_ITEM * entry, KD_CONFIG * config, KD_LIST_ITEM * def_ent } if (!StartKermitFileName && - !(StartKermitFileName = (ZIL_ICHAR *) new ZIL_ICHAR[BUFFERSIZE])) { + (StartKermitFileName = (ZIL_ICHAR *) new ZIL_ICHAR[BUFFERSIZE]) == NULL) { if ( !StartKermitFileName ) OutofMemory("Unable to create ICHAR CreateShortcut"); #ifdef WIN32 @@ -8945,7 +8945,7 @@ CreateScriptFile( KD_LIST_ITEM * entry, KD_CONFIG * config, KD_LIST_ITEM * def_e } if (!StartKermitFileName && - !(StartKermitFileName = (ZIL_ICHAR *) new ZIL_ICHAR[BUFFERSIZE])) { + (StartKermitFileName = (ZIL_ICHAR *) new ZIL_ICHAR[BUFFERSIZE]) == NULL) { if ( !StartKermitFileName ) OutofMemory("Unable to create ICHAR CreateScriptFile"); #ifdef WIN32 diff --git a/kermit/dialer/kquick.cpp b/kermit/dialer/kquick.cpp index ab93f1ee..d0a7b270 100644 --- a/kermit/dialer/kquick.cpp +++ b/kermit/dialer/kquick.cpp @@ -39,7 +39,7 @@ void K_QUICK::PopulateList( enum TRANSPORT type ) UIW_COMBO_BOX * combo = (UIW_COMBO_BOX *) Get( COMBO_QUICK ); UIW_VT_LIST * quicklist = (UIW_VT_LIST *) Get( LIST_QUICK ); UIW_BUTTON * button = NULL; - while ( button = (UIW_BUTTON *) quicklist->First() ) { + while ( (button = (UIW_BUTTON *)quicklist->First()) != NULL ) { *quicklist - button; delete button; } diff --git a/kermit/dialer/ksetgeneral.cpp b/kermit/dialer/ksetgeneral.cpp index 2382e0f0..2ddb29d6 100644 --- a/kermit/dialer/ksetgeneral.cpp +++ b/kermit/dialer/ksetgeneral.cpp @@ -912,7 +912,7 @@ InitTCPProtoList() { UIW_BUTTON * button; UIW_VT_LIST * list = (UIW_VT_LIST *) Get( LIST_TCP_PROTOCOL ) ; - while ( button = (UIW_BUTTON *) list->First() ) { + while ( (button = (UIW_BUTTON *)list->First()) != NULL ) { *list - button; delete button; } @@ -995,7 +995,7 @@ InitSSHProtoList() { UIW_BUTTON * button; UIW_VT_LIST * list = (UIW_VT_LIST *) Get( LIST_TCP_PROTOCOL ) ; - while ( button = (UIW_BUTTON *) list->First() ) { + while ( (button = (UIW_BUTTON *)list->First()) != NULL ) { *list - button; delete button; } diff --git a/kermit/dialer/ksetprinter.cpp b/kermit/dialer/ksetprinter.cpp index f472388b..74953a60 100644 --- a/kermit/dialer/ksetprinter.cpp +++ b/kermit/dialer/ksetprinter.cpp @@ -18,8 +18,12 @@ extern "C" { #include "ckcdeb.h" /* Typedefs, debug formats, etc */ #include "ckucmd.h" +#ifdef printf #undef printf +#endif +#ifdef fprintf #undef fprintf +#endif #include /* Windows Definitions */ } #endif /* WIN32 */ @@ -809,7 +813,7 @@ Win32EnumPrt( struct keytab ** pTable, struct keytab ** pTable2, int * pN ) // (simple error checking, if these work assume rest will too) // - if (!(pPrtInfo2 = (LPPRINTER_INFO_2) LocalAlloc (LPTR, dwBytesNeeded))) + if ((pPrtInfo2 = (LPPRINTER_INFO_2)LocalAlloc (LPTR, dwBytesNeeded)) == NULL) { return(FALSE); } diff --git a/kermit/dialer/main.cpp b/kermit/dialer/main.cpp index 879af3d2..e73e1514 100644 --- a/kermit/dialer/main.cpp +++ b/kermit/dialer/main.cpp @@ -15,8 +15,8 @@ #include "kwinmgr.hpp" #ifdef WIN32 extern "C" { -#define OS2 -#define NT +//#define OS2 +//#define NT #include "ckcdeb.h" #include "ckoetc.h" #ifndef NODIAL @@ -278,7 +278,7 @@ int UI_APPLICATION::Main(void) #ifdef WIN32 #ifndef NODIAL printf("Checking TAPI\n"); - if (TapiAvail = cktapiinit(hInstance)) { + if ((TapiAvail = cktapiinit(hInstance)) != 0) { printf("TAPI available\n"); cktapiopen(); printf("TAPI Open\n");