[PATCH 2/4] fstrim: initialize path variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reading the code this initialization is not necessary, so the change is
mostly about silencing a compiler warning and ensuring the program keeps
on working if there is a future bug that could make uninitialized 'path'
reachable to use.

sys-utils/fstrim.c:247: warning: 'path' may be used uninitialized in this
function

Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 sys-utils/fstrim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys-utils/fstrim.c b/sys-utils/fstrim.c
index 481a4cb..b18cdb2 100644
--- a/sys-utils/fstrim.c
+++ b/sys-utils/fstrim.c
@@ -244,7 +244,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
 
 int main(int argc, char **argv)
 {
-	char *path;
+	char *path = NULL;
 	int c, rc, verbose = 0, all = 0;
 	struct fstrim_range range;
 
-- 
2.1.2

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux