-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hw/ipmi/test/run-fru: Fix string truncation warning, enhance test
We've been getting this warning/error from recent GCC: In file included from hw/ipmi/test/run-fru.c:22: hw/ipmi/test/../ipmi-fru.c: In function ‘fru_add’: hw/ipmi/test/../ipmi-fru.c:162:3: warning: ‘strncpy’ output truncated copying 32 bytes from a string of length 38 [-Wstringop-truncation] strncpy(info.version, version, MAX_STR_LEN + 1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This patch does two things: 1) Re-arrange some code to shut GCC up. 2) Add extra fu to tests to ensure we're producing correct bytes. Signed-off-by: Stewart Smith <stewart@linux.ibm.com> Tested-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
- Loading branch information
1 parent
14a78d5
commit 043e85b
Showing
2 changed files
with
19 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters