Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
btrfs-progs: fix usage warning in common/help.c
On systems with glibc 2.34 and 2.39, the following warning appears when building the binary: [CC] common/help.o common/help.c: In function ‘usage’: common/help.c:315:58: warning: ‘%s’ directive argument is null [-Wformat-overflow=] 315 | fprintf(outf, "No short description for '%s'\n", token); | ^~ common/help.c:312:46: warning: ‘%s’ directive argument is null [-Wformat-overflow=] 312 | fprintf(outf, "No usage for '%s'\n", token); | ^~ This happens for usage() which passes NULL pointer as token. Normally this is fine, as fprintf() will output "(null)" for the NULL pointer, but it's still not ideal. Fix the warning by changing the token to "" if it's NULL. Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: Anand Jain <[email protected]>
- Loading branch information