Don't display non-fatal growbuf allocation warning
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7115 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
2bf0cf7025
commit
79056544b0
1 changed files with 6 additions and 2 deletions
|
@ -23,6 +23,7 @@
|
||||||
#include <cstring> // for memcpy
|
#include <cstring> // for memcpy
|
||||||
#include <cstdio> // for f*
|
#include <cstdio> // for f*
|
||||||
#include <algorithm> // for std::min
|
#include <algorithm> // for std::min
|
||||||
|
#include <cassert>
|
||||||
#include "tchar.h"
|
#include "tchar.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
|
@ -63,10 +64,12 @@ void GrowBuf::resize(GrowBuf::size_type newlen)
|
||||||
if (!newstor)
|
if (!newstor)
|
||||||
{
|
{
|
||||||
extern int g_display_errors;
|
extern int g_display_errors;
|
||||||
|
#ifdef _DEBUG
|
||||||
if (g_display_errors)
|
if (g_display_errors)
|
||||||
{
|
{
|
||||||
PrintColorFmtMsg_ERR(_T("\nack! realloc(%d) failed, trying malloc(%d)!\n"),m_alloc,newlen);
|
PrintColorFmtMsg_WARN(_T("\nwarning: realloc(%d) failed, trying malloc(%d)!\n"),m_alloc,newlen);
|
||||||
}
|
};
|
||||||
|
#endif
|
||||||
m_alloc=newlen; // try to malloc the minimum needed
|
m_alloc=newlen; // try to malloc the minimum needed
|
||||||
newstor=malloc(m_alloc);
|
newstor=malloc(m_alloc);
|
||||||
if (!newstor)
|
if (!newstor)
|
||||||
|
@ -74,6 +77,7 @@ void GrowBuf::resize(GrowBuf::size_type newlen)
|
||||||
extern void quit();
|
extern void quit();
|
||||||
if (g_display_errors)
|
if (g_display_errors)
|
||||||
{
|
{
|
||||||
|
assert(sizeof(size_type) == sizeof(int));
|
||||||
PrintColorFmtMsg_ERR(_T("\nInternal compiler error #12345: GrowBuf realloc/malloc(%d) failed.\n"),m_alloc);
|
PrintColorFmtMsg_ERR(_T("\nInternal compiler error #12345: GrowBuf realloc/malloc(%d) failed.\n"),m_alloc);
|
||||||
}
|
}
|
||||||
quit();
|
quit();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue