From e58e3c5e0a527802bd5286c537dc3ed603317c1d Mon Sep 17 00:00:00 2001 From: Jan Vorlicek Date: Fri, 9 Dec 2016 00:51:19 +0100 Subject: Remove sscanf and sprintf usage (#8508) * Remove sscanf * Remove sprintf --- src/ildasm/dis.cpp | 6 +++--- src/ildasm/dres.cpp | 4 ++-- src/ildasm/gui.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/ildasm') diff --git a/src/ildasm/dis.cpp b/src/ildasm/dis.cpp index ad5e5a7141..371466feee 100644 --- a/src/ildasm/dis.cpp +++ b/src/ildasm/dis.cpp @@ -475,7 +475,7 @@ void dumpOneEHInfo(DasmExceptionInfoClause* ehInfo, IMDInternalImport *pImport, /* if(ehInfo->GetFlags() & ERR_OUT_OF_CODE) { - sprintf(szString,"%s// WARNING: Boundary outside the method code",g_szAsmCodeIndent); + _snprintf_s(szString, _countof(szString), _TRUNCATE, "%s// WARNING: Boundary outside the method code",g_szAsmCodeIndent); printLine(GUICookie,szString); } */ @@ -863,8 +863,8 @@ BOOL SourceLinesHelper(void *GUICookie, LineCodeDescr* pLCD, __out_ecount(nSize) /* BOOL fHasEmbeddedSource=FALSE; ((ISymUnmanagedDocument*)(pParam->pLCD->FileToken))->HasEmbeddedSource(&fHasEmbeddedSource); - sprintf(szString,"%s// PDB has %sembedded source",g_szAsmCodeIndent, - fHasEmbeddedSource ? "" : "no "); + _snprintf_s(szString, _countof(szString), _TRUNCATE, "%s// PDB has %sembedded source",g_szAsmCodeIndent, + fHasEmbeddedSource ? "" : "no "); printLine(pParam->GUICookie,szString); */ } diff --git a/src/ildasm/dres.cpp b/src/ildasm/dres.cpp index 0f23fcc036..53e1925cea 100644 --- a/src/ildasm/dres.cpp +++ b/src/ildasm/dres.cpp @@ -281,11 +281,11 @@ DWORD DumpResourceToFile(__in __nullterminated WCHAR* wzFileName) void* GUICookie = (void*)wzFileName; BYTE* pbData; printLine(GUICookie,""); - sprintf(szString,"// ========== Win32 Resource Entries (%d) ========",ulNumResNodes); + sprintf_s(szString, _countof(szString), "// ========== Win32 Resource Entries (%d) ========",ulNumResNodes); for(i=0; i < ulNumResNodes; i++) { printLine(GUICookie,""); - sprintf(szString,"// Res.# %d Type=0x%X Name=0x%X Lang=0x%X DataOffset=0x%X DataLength=%d", + sprintf_s(szString, _countof(szString), "// Res.# %d Type=0x%X Name=0x%X Lang=0x%X DataOffset=0x%X DataLength=%d", i+1, g_prResNodePtr[i]->ResHdr.dwTypeID, g_prResNodePtr[i]->ResHdr.dwNameID, diff --git a/src/ildasm/gui.cpp b/src/ildasm/gui.cpp index f5f141d279..83501e66ef 100644 --- a/src/ildasm/gui.cpp +++ b/src/ildasm/gui.cpp @@ -2256,7 +2256,7 @@ void FindTextInListbox(HWND hwnd, FINDREPLACEW* lpfr) if(pos >= 0) { //char sz[32]; - //sprintf(sz,"%d:%d",strFind.chrg.cpMin,strFind.chrg.cpMax); + //sprintf_s(sz, _countof(sz), "%d:%d",strFind.chrg.cpMin,strFind.chrg.cpMax); //MessageBox(hwnd,sz,"Find",MB_OK); SendMessage(hwndLB,EM_SETSEL,(WPARAM)pos,(LPARAM)(pos+wcslen(lpfr->lpstrFindWhat))); } -- cgit v1.2.3