Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a format-truncation compiler warning. #1836

Merged
merged 2 commits into from
Aug 6, 2021
Merged

Conversation

nksauter
Copy link
Contributor

@nksauter nksauter commented Aug 4, 2021

gcc compiler produces a warning: 'snprintf' output truncated before the last format character,
and a note: 'snprintf' output 16 bytes into a destination of size 15.
The fix is to adjust the format string to 14 whitespaces, allowing the
15th position to be used for null-termination.

gcc compiler produces a warning: 'snprintf' output truncated before the last format character,
and a note: 'snprintf' output 16 bytes into a destination of size 15.
The fix is to adjust the format string to 14 whitespaces, allowing the
15th position to be used for null-termination.
@codecov
Copy link

codecov bot commented Aug 4, 2021

Codecov Report

Merging #1836 (a6c53b2) into main (fa58b57) will not change coverage.
The diff coverage is n/a.

❗ Current head a6c53b2 differs from pull request most recent head 849a5dc. Consider uploading reports for the commit 849a5dc to get more accurate results

@@           Coverage Diff           @@
##             main    #1836   +/-   ##
=======================================
  Coverage   67.15%   67.15%           
=======================================
  Files         617      617           
  Lines       69427    69427           
  Branches     9656     9656           
=======================================
  Hits        46621    46621           
  Misses      20867    20867           
  Partials     1939     1939           

@ndevenish
Copy link
Member

It looks like this line possibly isn't necessary at all. Or at least ostringstream would be cleaner and less confusing.

However, I'm pretty sure this is the reflection viewer and basically disused, so not really worth understanding what the routine is trying to do in the first place.

@ndevenish ndevenish merged commit 2561e78 into main Aug 6, 2021
@ndevenish ndevenish deleted the format_truncation branch August 6, 2021 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants