Skip to content
Browse files

Fix linker security warnings on str[n]cpy. Tweaked layout of view tab.

  • Loading branch information...
1 parent eaa8c06 commit 1eb0a0fd7c00f952f5948dcf72f6d1c9cebe30d7 @alexd committed Oct 24, 2010
Showing with 11 additions and 11 deletions.
  1. +5 −5 metapad.c
  2. +6 −6 metapad.rc
View
10 metapad.c
@@ -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
@@ -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';
@@ -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);
View
12 metapad.rc
@@ -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)

0 comments on commit 1eb0a0f

Please sign in to comment.
Something went wrong with that request. Please try again.