Skip to content

negf: Fix -Wformat-truncation warning

Alan Coopersmith requested to merge alanc/xcalc:warn into master
math.c: In function ‘negf’:
math.c:474:36: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
  474 |     snprintf(tmp, sizeof(tmp), "-%s", dispstr);
      |                                    ^
math.c:474:5: note: ‘snprintf’ output between 2 and 33 bytes into a
 destination of size 32
  474 |     snprintf(tmp, sizeof(tmp), "-%s", dispstr);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Merge request reports