소스 검색

Explicitly use n* version of vsnprintf (#4957)

Newest clang makes use of older version a warning, which we get as an
error
Greg Roth 2 년 전
부모
커밋
79efe5342e
3개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      include/dxc/Support/Global.h
  2. 1 1
      include/dxc/Support/WinAdapter.h
  3. 1 1
      tools/clang/lib/Parse/HLSLRootSignature.cpp

+ 1 - 1
include/dxc/Support/Global.h

@@ -167,7 +167,7 @@ inline void OutputDebugFormatA(_In_ _Printf_format_string_ _Null_terminated_ con
 
   va_list argList;
   va_start(argList, pszFormat);
-  int count = vsprintf_s(buffer, _countof(buffer), pszFormat, argList);
+  int count = vsnprintf_s(buffer, _countof(buffer), pszFormat, argList);
   va_end(argList);
 
   OutputDebugStringA(buffer);

+ 1 - 1
include/dxc/Support/WinAdapter.h

@@ -184,7 +184,7 @@
 #define _strdup strdup
 #define _strnicmp strnicmp
 
-#define vsprintf_s vsprintf
+#define vsnprintf_s vsnprintf
 #define strcat_s strcat
 #define strcpy_s(dst, n, src) strncpy(dst, src, n)
 #define _vscwprintf vwprintf

+ 1 - 1
tools/clang/lib/Parse/HLSLRootSignature.cpp

@@ -530,7 +530,7 @@ HRESULT RootSignatureParser::Error(uint32_t uErrorNum, LPCSTR pError, ...)
     va_list Args;
     char msg[512];
     va_start(Args, pError);
-    vsprintf_s(msg, pError, Args);
+    vsnprintf_s(msg, _countof(msg), pError, Args);
     va_end(Args);
     try {
       m_OS << msg;