-Wall fixes. Ambigious if/elses, uninitialized values, missing headers,

missing prototypes, and empty format strings.
This commit is contained in:
billf 1999-08-11 20:55:42 +00:00
parent d19c9420bd
commit a66efa8a50
7 changed files with 22 additions and 16 deletions

View File

@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
"$Id: perform.c,v 1.53 1998/09/11 07:26:54 jkh Exp $";
"$Id: perform.c,v 1.54 1998/12/16 13:59:29 jkh Exp $";
#endif
/*
@ -131,7 +131,7 @@ pkg_do(char *pkg)
}
Home = make_playpen(playpen, sb.st_size * 4);
if (!Home)
errx(1, "unable to make playpen for %d bytes", sb.st_size * 4);
errx(1, "unable to make playpen for %qd bytes", sb.st_size * 4);
where_to = Home;
/* Since we can call ourselves recursively, keep notes on where we came from */
if (!getenv("_TOP"))
@ -185,7 +185,7 @@ pkg_do(char *pkg)
*/
if (!inPlace && min_free(playpen) < sb.st_size * 4) {
warnx("projected size of %d exceeds available free space.\n"
warnx("projected size of %qd exceeds available free space.\n"
"Please set your PKG_TMPDIR variable to point to a location with more\n"
"free space and try again", sb.st_size * 4);
warnx("not extracting %s\ninto %s, sorry!",
@ -330,8 +330,8 @@ pkg_do(char *pkg)
if (fexists(POST_INSTALL_FNAME)) {
new_m = 1;
sprintf(post_script, "%s", POST_INSTALL_FNAME);
sprintf(pre_arg, "");
sprintf(post_arg, "");
pre_arg[0] = '\0';
post_arg[0] = '\0';
} else {
if (fexists(INSTALL_FNAME)) {
sprintf(post_script, "%s", INSTALL_FNAME);

View File

@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
"$Id: perform.c,v 1.46 1998/12/05 06:28:58 asami Exp $";
"$Id: perform.c,v 1.47 1998/12/16 13:59:30 jkh Exp $";
#endif
/*
@ -46,7 +46,7 @@ pkg_perform(char **pkgs)
Package plist;
int len;
char *suf;
int compress;
int compress = 0;
/* Preliminary setup */
sanity_check();
@ -67,7 +67,7 @@ pkg_perform(char **pkgs)
/* chop suffix off if already specified, remembering if we want to compress */
len = strlen(pkg);
if (len > 4)
if (len > 4) {
if (!strcmp(&pkg[len - 4], ".tgz")) {
compress = TRUE;
pkg[len - 4] = '\0';
@ -79,6 +79,7 @@ pkg_perform(char **pkgs)
else
/* default is to compress packages */
compress = TRUE;
}
if (compress)
suf = "tgz";
else

View File

@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
"$Id: perform.c,v 1.17 1998/11/11 06:09:04 jkh Exp $";
"$Id: perform.c,v 1.18 1998/12/16 13:59:30 jkh Exp $";
#endif
/*
@ -144,8 +144,8 @@ pkg_do(char *pkg)
if (fexists(POST_DEINSTALL_FNAME)) {
new_m = 1;
sprintf(post_script, "%s", POST_DEINSTALL_FNAME);
sprintf(pre_arg, "");
sprintf(post_arg, "");
pre_arg[0] = '\0';
post_arg[0] = '\0';
} else {
if (fexists(DEINSTALL_FNAME)) {
sprintf(post_script, "%s", DEINSTALL_FNAME);

View File

@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
"$Id: perform.c,v 1.26 1998/12/16 13:59:31 jkh Exp $";
"$Id: perform.c,v 1.27 1999/07/30 23:14:15 jdp Exp $";
#endif
/*
@ -28,6 +28,7 @@ static const char rcsid[] =
#include <fts.h>
#include <signal.h>
#include <err.h>
static int fname_cmp(const FTSENT **, const FTSENT **);
static int pkg_do(char *);

View File

@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
"$Id: show.c,v 1.11 1997/10/08 07:47:38 charnier Exp $";
"$Id: show.c,v 1.12 1997/10/18 05:42:05 jkh Exp $";
#endif
/*
@ -26,6 +26,8 @@ static const char rcsid[] =
#include "lib.h"
#include "info.h"
#include <err.h>
void
show_file(char *title, char *fname)
{

View File

@ -1,4 +1,4 @@
/* $Id: lib.h,v 1.26 1998/02/16 17:16:47 jkh Exp $ */
/* $Id: lib.h,v 1.27 1998/12/16 13:59:31 jkh Exp $ */
/*
* FreeBSD install - a package for the installation and maintainance
@ -165,6 +165,7 @@ void write_plist(Package *, FILE *);
void read_plist(Package *, FILE *);
int plist_cmd(char *, char **);
int delete_package(Boolean, Boolean, Package *);
Boolean make_preserve_name(char *, int, char *, char *);
/* For all */
int pkg_perform(char **);

View File

@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
"$Id: plist.c,v 1.26 1998/09/01 06:58:11 jkh Exp $";
"$Id: plist.c,v 1.27 1998/09/11 07:26:58 jkh Exp $";
#endif
/*
@ -493,11 +493,12 @@ delete_hierarchy(char *dir, Boolean ign_err, Boolean nukedirs)
*cp2 = '\0';
if (!isemptydir(dir))
return 0;
if (RMDIR(dir) && !ign_err)
if (RMDIR(dir) && !ign_err) {
if (!fexists(dir))
warnx("directory `%s' doesn't really exist", dir);
else
return 1;
}
/* back up the pathname one component */
if (cp2) {
cp1 = dir;