Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Nov 2008 00:09:01 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r185073 - head/usr.sbin/ckdist
Message-ID:  <200811190009.mAJ091Hj098084@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Wed Nov 19 00:09:01 2008
New Revision: 185073
URL: http://svn.freebsd.org/changeset/base/185073

Log:
  Constify return value of stripath and avoid unnecessary deconst
  casts.

Modified:
  head/usr.sbin/ckdist/ckdist.c

Modified: head/usr.sbin/ckdist/ckdist.c
==============================================================================
--- head/usr.sbin/ckdist/ckdist.c	Tue Nov 18 23:38:47 2008	(r185072)
+++ head/usr.sbin/ckdist/ckdist.c	Wed Nov 19 00:09:01 2008	(r185073)
@@ -80,7 +80,7 @@ static int chkinf(FILE * fp, const char 
 static int report(const char *path, const char *name, int error);
 static const char *distname(const char *path, const char *name,
 	                    const char *ext);
-static char *stripath(const char *path);
+static const char *stripath(const char *path);
 static int distfile(const char *path);
 static int disttype(const char *name);
 static int fail(const char *path, const char *msg);
@@ -247,7 +247,7 @@ chkmd5(FILE * fp, const char *path)
 		    error = E_ERRNO;
 		else if (close(fd))
 		    err(2, "%s", dname);
-	    } else if (!MD5File((char *)dname, chk))
+	    } else if (!MD5File(dname, chk))
 		error = E_ERRNO;
 	    else if (strcmp(chk, sum))
 		error = E_CHKSUM;
@@ -393,12 +393,12 @@ distname(const char *path, const char *n
     return buf;
 }
 
-static char *
+static const char *
 stripath(const char *path)
 {
     const char *s;
 
-    return (char *)((s = strrchr(path, '/')) != NULL && s[1] ? 
+    return ((s = strrchr(path, '/')) != NULL && s[1] ? 
 		    s + 1 : path);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811190009.mAJ091Hj098084>