X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=args.h;h=6f5144628293b03888741abdf766c416ccc3a63e;hb=a7ba1da07dbc23fe0e310d51b7bdf2d2a1bc1004;hp=6ea023730fca82de60bb7ca5a133222f91da6e2e;hpb=78541dc0a4c7d4bbd83c91e59d38d4f0b8ff4095;p=xboard.git diff --git a/args.h b/args.h index 6ea0237..6f51446 100644 --- a/args.h +++ b/args.h @@ -768,7 +768,7 @@ ExitArgError(char *msg, char *badArg, Boolean quit) int len; len = snprintf(buf,MSG_SIZ, "%s %s", msg, badArg); - if( (len > MSG_SIZ) && appData.debugMode ) + if( (len >= MSG_SIZ) && appData.debugMode ) fprintf(debugFP, "ExitArgError: buffer truncated. Input: msg=%s badArg=%s\n", msg, badArg); if(!quit) { printf(_("%s in settings file\n"), buf); return; } // DisplayError does not work yet at this stage... @@ -820,7 +820,7 @@ ParseSettingsFile(char *name, char **addr) if(!ok && strchr(name, '.') == NULL) { // append default file-name extension '.ini' when needed len = snprintf(buf,MSG_SIZ, "%s.ini", name); - if( (len > MSG_SIZ) && appData.debugMode ) + if( (len >= MSG_SIZ) && appData.debugMode ) fprintf(debugFP, "ParseSettingsFile: buffer truncated. Input: name=%s \n",name); ok = MySearchPath(installDir, buf, fullname); @@ -1267,7 +1267,7 @@ InitAppData(char *lpCmdLine) if(p != NULL) { // engine command line contains WinBoard options len = snprintf(buf, MSG_SIZ, p+6, f, f, f, f, f, f, f, f, f, f); // replace %s in them by "first" - if( (len > MSG_SIZ) && appData.debugMode ) + if( (len >= MSG_SIZ) && appData.debugMode ) fprintf(debugFP, "InitAppData: buffer truncated.\n"); ParseArgs(StringGet, &q); @@ -1284,7 +1284,7 @@ InitAppData(char *lpCmdLine) if(p != NULL) { // engine command line contains WinBoard options len = snprintf(buf,MSG_SIZ, p+6, s, s, s, s, s, s, s, s, s, s); // replace %s in them by "first" - if( (len > MSG_SIZ) && appData.debugMode ) + if( (len >= MSG_SIZ) && appData.debugMode ) fprintf(debugFP, "InitAppData: buffer truncated.\n"); ParseArgs(StringGet, &q); @@ -1483,13 +1483,13 @@ GetArgValue(char *name) return TRUE; case ArgInt: len = snprintf(name, MSG_SIZ, "%d", *(int*) ad->argLoc); - if( (len > MSG_SIZ) && appData.debugMode ) + if( (len >= MSG_SIZ) && appData.debugMode ) fprintf(debugFP, "GetArgValue: buffer truncated.\n"); return TRUE; case ArgBoolean: len = snprintf(name, MSG_SIZ, "%s", *(Boolean*) ad->argLoc ? "true" : "false"); - if( (len > MSG_SIZ) && appData.debugMode ) + if( (len >= MSG_SIZ) && appData.debugMode ) fprintf(debugFP, "GetArgValue: buffer truncated.\n"); return TRUE;