Skip to content

Commit bc21376

Browse files
committed
Compilation waring in pre.l
In `pre.l` we got warnings like: ``` .../src/pre.l:4094:33: warning: ‘ ’ directive output may be truncated writing 1 byte into a region of size between 0 and 5 [-Wformat-truncation=] 4094 | contents+=lineNrStr; | ^ .../src/pre.l:4094:19: note: ‘snprintf’ output between 7 and 12 bytes into a destination of size 10 4094 | contents+=lineNrStr; | ~~~~~~~~^~~~~~~~~~~~ ``` Increasing the buffer slightly resolves this problem.
1 parent 1040db6 commit bc21376

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pre.l

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4089,8 +4089,8 @@ void Preprocessor::processFile(const QCString &fileName,const std::string &input
40894089
{
40904090
if (startOfLine)
40914091
{
4092-
char lineNrStr[10];
4093-
snprintf(lineNrStr,10,"%05d ",line++);
4092+
char lineNrStr[15];
4093+
snprintf(lineNrStr,15,"%05d ",line++);
40944094
contents+=lineNrStr;
40954095
}
40964096
contents += output[pos];

0 commit comments

Comments
 (0)