Cleanup pax(1) sources a little bit while I poked around in them:

- remove a superfluous doubled trailing semicolon.
- remove the extra void casts on calls to void-function free(3).
This commit is contained in:
Ralf S. Engelschall 2007-05-24 06:44:37 +00:00
parent f31380b233
commit f2703795ca
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=169926
5 changed files with 25 additions and 25 deletions

View File

@ -1229,7 +1229,7 @@ ar_next(void)
*/
if (ar_open(buf) >= 0) {
if (freeit) {
(void)free((char *)(uintptr_t)arcname);
free((char *)(uintptr_t)arcname);
freeit = 0;
}
if ((arcname = strdup(buf)) == NULL) {

View File

@ -284,7 +284,7 @@ mk_link(char *to, struct stat *to_sb, char *from,
*/
if ((to_sb->st_dev==sb.st_dev)&&(to_sb->st_ino == sb.st_ino)) {
paxwarn(1, "Unable to link file %s to itself", to);
return(-1);;
return(-1);
}
/*

View File

@ -140,7 +140,7 @@ rep_add(char *str)
regerror(res, &(rep->rcmp), rebuf, sizeof(rebuf));
paxwarn(1, "%s while compiling regular expression %s", rebuf, str);
# endif
(void)free((char *)rep);
free((char *)rep);
return(-1);
}
@ -152,11 +152,11 @@ rep_add(char *str)
*pt1++ = *str;
if ((pt2 = strchr(pt1, *str)) == NULL) {
# ifdef NET2_REGEX
(void)free((char *)rep->rcmp);
free((char *)rep->rcmp);
# else
regfree(&(rep->rcmp));
# endif
(void)free((char *)rep);
free((char *)rep);
paxwarn(1, "Invalid replacement string %s", str);
return(-1);
}
@ -181,11 +181,11 @@ rep_add(char *str)
break;
default:
# ifdef NET2_REGEX
(void)free((char *)rep->rcmp);
free((char *)rep->rcmp);
# else
regfree(&(rep->rcmp));
# endif
(void)free((char *)rep);
free((char *)rep);
*pt1 = *str;
paxwarn(1, "Invalid replacement string option %s", str);
return(-1);
@ -401,7 +401,7 @@ pat_sel(ARCHD *arcn)
return(-1);
}
*ppt = pt->fow;
(void)free((char *)pt);
free((char *)pt);
arcn->pat = NULL;
return(0);
}

View File

@ -412,7 +412,7 @@ trng_add(char *str)
*/
if (str_sec(str, &(pt->low_time)) < 0) {
paxwarn(1, "Illegal lower time range %s", str);
(void)free((char *)pt);
free((char *)pt);
goto out;
}
pt->flgs |= HASLOW;
@ -424,7 +424,7 @@ trng_add(char *str)
*/
if (str_sec(up_pt, &(pt->high_time)) < 0) {
paxwarn(1, "Illegal upper time range %s", up_pt);
(void)free((char *)pt);
free((char *)pt);
goto out;
}
pt->flgs |= HASHIGH;
@ -436,7 +436,7 @@ trng_add(char *str)
if (pt->low_time > pt->high_time) {
paxwarn(1, "Upper %s and lower %s time overlap",
up_pt, str);
(void)free((char *)pt);
free((char *)pt);
return(-1);
}
}

View File

@ -178,8 +178,8 @@ chk_lnk(ARCHD *arcn)
*/
if (--pt->nlink <= 1) {
*ppt = pt->fow;
(void)free((char *)pt->name);
(void)free((char *)pt);
free((char *)pt->name);
free((char *)pt);
}
return(1);
}
@ -198,7 +198,7 @@ chk_lnk(ARCHD *arcn)
ltab[indx] = pt;
return(0);
}
(void)free((char *)pt);
free((char *)pt);
}
paxwarn(1, "Hard link table out of memory");
@ -254,8 +254,8 @@ purg_lnk(ARCHD *arcn)
* remove and free it
*/
*ppt = pt->fow;
(void)free((char *)pt->name);
(void)free((char *)pt);
free((char *)pt->name);
free((char *)pt);
}
/*
@ -288,8 +288,8 @@ lnk_end(void)
while (pt != NULL) {
ppt = pt;
pt = ppt->fow;
(void)free((char *)ppt->name);
(void)free((char *)ppt);
free((char *)ppt->name);
free((char *)ppt);
}
}
return;
@ -460,7 +460,7 @@ chk_ftime(ARCHD *arcn)
paxwarn(1, "File time table ran out of memory");
if (pt != NULL)
(void)free((char *)pt);
free((char *)pt);
return(-1);
}
@ -538,7 +538,7 @@ add_name(char *oname, int onamelen, char *nname)
if (strcmp(nname, pt->nname) == 0)
return(0);
(void)free((char *)pt->nname);
free((char *)pt->nname);
if ((pt->nname = strdup(nname)) == NULL) {
paxwarn(1, "Cannot update rename table");
return(-1);
@ -557,9 +557,9 @@ add_name(char *oname, int onamelen, char *nname)
ntab[indx] = pt;
return(0);
}
(void)free((char *)pt->oname);
free((char *)pt->oname);
}
(void)free((char *)pt);
free((char *)pt);
}
paxwarn(1, "Interactive rename table out of memory");
return(-1);
@ -994,7 +994,7 @@ add_atdir(char *fname, dev_t dev, ino_t ino, time_t mtime, time_t atime)
atab[indx] = pt;
return;
}
(void)free((char *)pt);
free((char *)pt);
}
paxwarn(1, "Directory access time reset table ran out of memory");
@ -1051,8 +1051,8 @@ get_atdir(dev_t dev, ino_t ino, time_t *mtime, time_t *atime)
*ppt = pt->fow;
*mtime = pt->mtime;
*atime = pt->atime;
(void)free((char *)pt->name);
(void)free((char *)pt);
free((char *)pt->name);
free((char *)pt);
return(0);
}