Skip to content

Commit

Permalink
Fix linker security warnings on str[n]cpy. Tweaked layout of view tab.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexd committed Oct 24, 2010
1 parent eaa8c06 commit 1eb0a0f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions metapad.c
Expand Up @@ -139,9 +139,9 @@ extern atoi(const char*);
#endif
#else
#ifdef USE_RICH_EDIT
#define STR_ABOUT_NORMAL _T("metapad 3.6 b1")
#define STR_ABOUT_NORMAL _T("metapad 3.6 beta 1")
#else
#define STR_ABOUT_NORMAL _T("metapad LE 3.6 b1")
#define STR_ABOUT_NORMAL _T("metapad LE 3.6 beta 1")
#endif
#endif

Expand Down Expand Up @@ -1566,7 +1566,7 @@ int FixShortFilename(TCHAR *szSrc, TCHAR *szDest)
}
}

_tcsncpy(sDir, szDest, nDestPos);
_tcsncpy_s(sDir, sizeof(szDest), szDest, nDestPos);
sDir[nDestPos] = '*';
sDir[nDestPos + 1] = '\0';

Expand All @@ -1580,9 +1580,9 @@ int FixShortFilename(TCHAR *szSrc, TCHAR *szDest)
bOK = FindNextFile(hHandle, &FindFileData);

if (bOK)
_tcscpy(&szDest[nDestPos], FindFileData.cFileName);
_tcscpy_s(&szDest[nDestPos], sizeof(FindFileData.cFileName), FindFileData.cFileName);
else
_tcscpy(&szDest[nDestPos], sName);
_tcscpy_s(&szDest[nDestPos], sizeof(sName), sName);

// Fix the length of szDest
nDestPos = _tcslen(szDest);
Expand Down
12 changes: 6 additions & 6 deletions metapad.rc
Expand Up @@ -300,16 +300,16 @@ BEGIN
CONTROL "font",IDC_COLOUR_FONT2,"Button",BS_OWNERDRAW,183,91,26,
11
GROUPBOX "Window",IDC_STATIC,7,113,211,47
LTEXT "&Selection margin width:",IDC_STATIC,15,124,52,15
EDITTEXT IDC_EDIT_SM_WIDTH,79,126,24,12,ES_CENTER |
LTEXT "&Selection margin width:",IDC_STATIC,15,128,82,16
EDITTEXT IDC_EDIT_SM_WIDTH,94,127,24,12,ES_CENTER |
ES_AUTOHSCROLL
LTEXT "&Transparency %:",IDC_STAT_TRANS,120,
124,58,16
EDITTEXT IDC_EDIT_TRANSPARENT,184,126,24,12,ES_CENTER |
LTEXT "&Transparency %:",IDC_STAT_TRANS,129,
128,58,16
EDITTEXT IDC_EDIT_TRANSPARENT,185,127,24,12,ES_CENTER |
ES_AUTOHSCROLL
CONTROL "Use def&ault toolbar style",
IDC_FLAT_TOOLBAR,"Button",BS_AUTOCHECKBOX | BS_MULTILINE |
WS_TABSTOP,16,145,176,9
WS_TABSTOP,16,143,176,9
END

#if defined(APSTUDIO_INVOKED) || defined(USE_RICH_EDIT)
Expand Down

0 comments on commit 1eb0a0f

Please sign in to comment.