Use sizeOfType() instead of sizeof(void*)
This commit is contained in:
parent
03e7914c98
commit
ee7b09fb8d
|
@ -767,7 +767,7 @@ void CheckBufferOverrun::checkStructVariable()
|
|||
int arrsize = std::atoi(tok2->strAt(ivar + 2));
|
||||
int total_size = arrsize * _tokenizer->sizeOfType(tok2->tokAt(1));
|
||||
if (tok2->tokAt(2)->str() == "*")
|
||||
total_size = arrsize * sizeof(void *);
|
||||
total_size = arrsize * _tokenizer->sizeOfType(tok2->tokAt(2));
|
||||
if (total_size == 0)
|
||||
continue;
|
||||
|
||||
|
|
|
@ -1277,7 +1277,7 @@ std::string Preprocessor::getcode(const std::string &filedata, std::string cfg,
|
|||
// We must not remove #file tags or line numbers
|
||||
// are corrupted. File tags are removed by the tokenizer.
|
||||
}
|
||||
else if (!match || line.compare(0,1,"#") == 0)
|
||||
else if (!match || line.compare(0, 1, "#") == 0)
|
||||
{
|
||||
// Remove #if, #else, #pragma etc, leaving only
|
||||
// #define, #undef, #file and #endfile. and also lines
|
||||
|
|
Loading…
Reference in New Issue