if(currentPiece != EmptySquare) {\r
char buf[MSG_SIZ];\r
n = boards[currentMove][fromY][BOARD_WIDTH-2];\r
- snprintf(buf, MSG)SIZ,"%d %s%s", n, PieceToName(currentPiece,0), n == 1 ? "" : "s");\r
+ snprintf(buf, MSG_SIZ,"%d %s%s", n, PieceToName(currentPiece,0), n == 1 ? "" : "s");\r
SayString(buf, TRUE);\r
}\r
} else\r
GlobalFree(hGlobalMem);\r
return FALSE;\r
}\r
- safeStrCpy(lpGlobalMem, text, sizeof(lpGlobalMem)/sizeof(lpGlobalMem[0]) );\r
+ safeStrCpy(lpGlobalMem, text, 1<<20);\r
if (appData.debugMode) {\r
lockCount = GlobalFlags(hGlobalMem) & GMEM_LOCKCOUNT;\r
fprintf(debugFP, "CopyTextToClipboard(): lock count %d\n", lockCount);\r
CloseClipboard();\r
return FALSE;\r
}\r
- safeStrCpy(*text, lpClipMem, sizeof(*text)/sizeof(*text[0]) );\r
+ safeStrCpy(*text, lpClipMem, 1<<20 );\r
if (appData.debugMode) {\r
lockCount = GlobalFlags(hClipMem) & GMEM_LOCKCOUNT;\r
fprintf(debugFP, "PasteTextFromClipboard(): lock count %d\n", lockCount);\r
\r
if (fileName == NULL) fileName = buf1;\r
if (defName == NULL) {\r
- safeStrCpy(fileName, "*.", sizeof(fileName)/sizeof(fileName[0]) );\r
+ safeStrCpy(fileName, "*.", 3 );\r
strcat(fileName, defExt);\r
} else {\r
- safeStrCpy(fileName, defName, sizeof(fileName)/sizeof(fileName[0]) );\r
+ safeStrCpy(fileName, defName, MSG_SIZ );\r
}\r
- if (fileTitle) safeStrCpy(fileTitle, "", sizeof(fileTitle)/sizeof(fileTitle[0]) );\r
+ if (fileTitle) safeStrCpy(fileTitle, "", MSG_SIZ );\r
if (number) *number = 0;\r
\r
openFileName.lStructSize = sizeof(OPENFILENAME);\r
success = GetDlgItemText( hDlg, 2001+2*i, newText, MSG_SIZ - strlen(cps->option[j].name) - 9 );\r
if(!success) break;\r
changed = strcmp(cps->option[j].textValue, newText) != 0;\r
- safeStrCpy(cps->option[j].textValue, newText, sizeof(cps->option[j].textValue)/sizeof(cps->option[j].textValue[0]) );\r
+ safeStrCpy(cps->option[j].textValue, newText, MSG_SIZ - (cps->option[j].textValue - cps->option[j].name) );\r
break;\r
case CheckBox:\r
new = IsDlgButtonChecked( hDlg, 2000+2*i );\r