From e319f0ed8bf110d3b614f8e1feca73e6601b4a2d Mon Sep 17 00:00:00 2001 From: Garrett Wollman Date: Sun, 15 Jul 2012 15:44:42 -0400 Subject: [PATCH] vol: dead initialization in VWalkVolumeHeaders() Actually, all of the initializers in this small function are dead. Change-Id: If89fe3222ec39b34233f92f3aafd458f5723b0c5 Reviewed-on: http://gerrit.openafs.org/7771 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/vol/vutil.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vol/vutil.c b/src/vol/vutil.c index 007b1ec3a..3407d5aff 100644 --- a/src/vol/vutil.c +++ b/src/vol/vutil.c @@ -827,8 +827,8 @@ int VWalkVolumeHeaders(struct DiskPartition64 *dp, const char *partpath, VWalkVolFunc volfunc, VWalkErrFunc errfunc, void *rock) { - DIR *dirp = NULL; - struct dirent *dentry = NULL; + DIR *dirp; + struct dirent *dentry; int code = 0; struct VolumeDiskHeader diskHeader; @@ -839,8 +839,8 @@ VWalkVolumeHeaders(struct DiskPartition64 *dp, const char *partpath, goto done; } - while ((dentry = readdir(dirp))) { - char *p = dentry->d_name; + while ((dentry = readdir(dirp)) != NULL) { + char *p; p = strrchr(dentry->d_name, '.'); if (p != NULL && strcmp(p, VHDREXT) == 0) { char name[VMAXPATHLEN]; -- 2.39.5