From 527edfe136ec14334530b5764f8c07e0808d2f3e Mon Sep 17 00:00:00 2001 From: joerg Date: Thu, 19 Jul 2012 06:33:03 +0000 Subject: [PATCH] Always initialize part to avoid triggering uninitialized variable warnings. --- lib/libukfs/ukfs.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/libukfs/ukfs.h b/lib/libukfs/ukfs.h index ffd55b7786b1..8c5ec04c477f 100644 --- a/lib/libukfs/ukfs.h +++ b/lib/libukfs/ukfs.h @@ -1,4 +1,4 @@ -/* $NetBSD: ukfs.h,v 1.13 2009/12/03 14:23:49 pooka Exp $ */ +/* $NetBSD: ukfs.h,v 1.14 2012/07/19 06:33:03 joerg Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Antti Kantee. All Rights Reserved. @@ -130,8 +130,9 @@ extern struct ukfs_part *ukfs_part_na; #define UKFS_DEVICE_ARGVPROBE(part) \ do { \ - if (argc >= 3) \ - if (ukfs_part_probe(argv[argc-2], part) == -1) \ + if (argc < 3) \ + *part = NULL; \ + else if (ukfs_part_probe(argv[argc-2], part) == -1) \ err(1, "ukfs_part_probe"); \ } while (/*CONSTCOND*/0)