mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
Replaced swscanf with the safer swscanf_s
This commit is contained in:
parent
0fa9cdbc4b
commit
eef8262263
16
.gitignore
vendored
16
.gitignore
vendored
@ -1 +1,15 @@
|
||||
Build/Bin/upx.exe
|
||||
*.ilk
|
||||
*.lib
|
||||
*.obj
|
||||
*.pdb
|
||||
*.res
|
||||
*.sdf
|
||||
*.tlog
|
||||
|
||||
Build/Bin/upx.exe
|
||||
Bin/Debug_x86/Notepad3.exe
|
||||
Bin/Debug_x86/obj/Notepad3.log
|
||||
Bin/Debug_x86/obj/scintilla/Scintilla.idb
|
||||
Bin/Debug_x86/obj/scintilla/Scintilla.log
|
||||
Bin/Debug_x86/obj/vc140.idb
|
||||
Build/.vs/Notepad3/v14/.suo
|
||||
@ -1,4 +1,4 @@
|
||||
[Version]
|
||||
Build=194
|
||||
Build=197
|
||||
VersionHeader=src\VersionEx.h
|
||||
ManifestConfig=res\Notepad3.exe.manifest.conf
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<assemblyIdentity
|
||||
name="Notepad3"
|
||||
processorArchitecture="*"
|
||||
version="0.1.9.194"
|
||||
version="0.1.9.197"
|
||||
type="win32"
|
||||
/>
|
||||
<description>Notepad3</description>
|
||||
|
||||
@ -81,7 +81,7 @@ int IniSectionGetInt(
|
||||
|
||||
while (*p) {
|
||||
if (StrCmpNI(p,tch,ich) == 0) {
|
||||
if (swscanf(p + ich,L"%i",&i) == 1)
|
||||
if (swscanf_s(p + ich,L"%i",&i) == 1)
|
||||
return(i);
|
||||
else
|
||||
return(iDefault);
|
||||
@ -872,7 +872,7 @@ int Toolbar_SetButtons(HWND hwnd,int cmdBase,LPCWSTR lpszButtons,LPCTBBUTTON ptb
|
||||
|
||||
p = tchButtons;
|
||||
while (*p) {
|
||||
if (swscanf(p,L"%i",&iCmd) == 1) {
|
||||
if (swscanf_s(p,L"%i",&iCmd) == 1) {
|
||||
iCmd = (iCmd==0)?0:iCmd+cmdBase-1;
|
||||
for (i = 0; i < ctbb; i++) {
|
||||
if (ptbb[i].idCommand == iCmd) {
|
||||
|
||||
@ -6132,7 +6132,7 @@ void ParseCommandLine()
|
||||
}
|
||||
else if (ExtractFirstArgument(lp2,lp1,lp2)) {
|
||||
int itok =
|
||||
swscanf(lp1,L"%i,%i,%i,%i,%i",&wi.x,&wi.y,&wi.cx,&wi.cy,&wi.max);
|
||||
swscanf_s(lp1,L"%i,%i,%i,%i,%i",&wi.x,&wi.y,&wi.cx,&wi.cy,&wi.max);
|
||||
if (itok == 4 || itok == 5) { // scan successful
|
||||
flagPosParam = 1;
|
||||
flagDefaultPos = 0;
|
||||
@ -6171,7 +6171,7 @@ void ParseCommandLine()
|
||||
case L'G':
|
||||
if (ExtractFirstArgument(lp2,lp1,lp2)) {
|
||||
int itok =
|
||||
swscanf(lp1,L"%i,%i",&iInitialLine,&iInitialColumn);
|
||||
swscanf_s(lp1,L"%i,%i",&iInitialLine,&iInitialColumn);
|
||||
if (itok == 1 || itok == 2) { // scan successful
|
||||
flagJumpTo = 1;
|
||||
}
|
||||
|
||||
10
src/Styles.c
10
src/Styles.c
@ -2547,7 +2547,7 @@ void Style_Load()
|
||||
wsprintf(tch,L"%02i",i+1);
|
||||
if (IniSectionGetString(pIniSection,tch,L"",wch,COUNTOF(wch))) {
|
||||
if (wch[0] == L'#') {
|
||||
itok = swscanf(CharNext(wch),L"%x",&irgb);
|
||||
itok = swscanf_s(CharNext(wch),L"%x",&irgb);
|
||||
if (itok == 1)
|
||||
crCustom[i] = RGB((irgb&0xFF0000) >> 16,(irgb&0xFF00) >> 8,irgb&0xFF);
|
||||
}
|
||||
@ -3632,7 +3632,7 @@ BOOL Style_StrGetCharSet(LPCWSTR lpszStyle,int *i)
|
||||
if (p = StrChr(tch,L';'))
|
||||
*p = L'\0';
|
||||
TrimString(tch);
|
||||
itok = swscanf(tch,L"%i",&iValue);
|
||||
itok = swscanf_s(tch,L"%i",&iValue);
|
||||
if (itok == 1)
|
||||
{
|
||||
*i = iValue;
|
||||
@ -3671,7 +3671,7 @@ BOOL Style_StrGetSize(LPCWSTR lpszStyle,int *i)
|
||||
if (p = StrChr(tch,L';'))
|
||||
*p = L'\0';
|
||||
TrimString(tch);
|
||||
itok = swscanf(tch,L"%i",&iValue);
|
||||
itok = swscanf_s(tch,L"%i",&iValue);
|
||||
if (itok == 1)
|
||||
{
|
||||
if (iSign == 0)
|
||||
@ -3727,7 +3727,7 @@ BOOL Style_StrGetColor(BOOL bFore,LPCWSTR lpszStyle,int *rgb)
|
||||
if (p = StrChr(tch,L';'))
|
||||
*p = L'\0';
|
||||
TrimString(tch);
|
||||
itok = swscanf(tch,L"%x",&iValue);
|
||||
itok = swscanf_s(tch,L"%x",&iValue);
|
||||
if (itok == 1)
|
||||
{
|
||||
*rgb = RGB((iValue&0xFF0000) >> 16,(iValue&0xFF00) >> 8,iValue&0xFF);
|
||||
@ -3783,7 +3783,7 @@ BOOL Style_StrGetAlpha(LPCWSTR lpszStyle,int *i)
|
||||
if (p = StrChr(tch,L';'))
|
||||
*p = L'\0';
|
||||
TrimString(tch);
|
||||
itok = swscanf(tch,L"%i",&iValue);
|
||||
itok = swscanf_s(tch,L"%i",&iValue);
|
||||
if (itok == 1)
|
||||
{
|
||||
*i = min(max(SC_ALPHA_TRANSPARENT,iValue),SC_ALPHA_OPAQUE);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#define VERSION_MAJOR 0
|
||||
#define VERSION_MINOR 1
|
||||
#define VERSION_REV 9
|
||||
#define VERSION_BUILD 194
|
||||
#define VERSION_BUILD 197
|
||||
|
||||
Loading…
Reference in New Issue
Block a user