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, causing concern that something has failed. [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); | ^~ The compiler warns that in some code paths, the token is `NULL`. Silence the warning by checking if the token is `NULL`. Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: Anand Jain <[email protected]>
- Loading branch information