Use size_t instead of int where appropriate.
This commit is contained in:
parent
947172fa2b
commit
dc6635b518
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cmds.c,v 1.113 2005/05/19 02:55:37 lukem Exp $ */
|
||||
/* $NetBSD: cmds.c,v 1.114 2005/05/19 03:05:04 lukem Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996-2005 The NetBSD Foundation, Inc.
|
||||
@ -103,7 +103,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)cmds.c 8.6 (Berkeley) 10/9/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: cmds.c,v 1.113 2005/05/19 02:55:37 lukem Exp $");
|
||||
__RCSID("$NetBSD: cmds.c,v 1.114 2005/05/19 03:05:04 lukem Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -1331,7 +1331,7 @@ ls(int argc, char *argv[])
|
||||
|
||||
if (pagecmd) {
|
||||
char *p;
|
||||
int len;
|
||||
size_t len;
|
||||
|
||||
p = getoptionvalue("pager");
|
||||
if (EMPTYSTRING(p))
|
||||
@ -2525,7 +2525,7 @@ newer(int argc, char *argv[])
|
||||
void
|
||||
lpage(int argc, char *argv[])
|
||||
{
|
||||
int len;
|
||||
size_t len;
|
||||
char *p, *pager, *locfile;
|
||||
|
||||
if (argc == 0 || argc > 2 ||
|
||||
@ -2558,7 +2558,8 @@ lpage(int argc, char *argv[])
|
||||
void
|
||||
page(int argc, char *argv[])
|
||||
{
|
||||
int ohash, orestart_point, overbose, len;
|
||||
int ohash, orestart_point, overbose;
|
||||
size_t len;
|
||||
char *p, *pager;
|
||||
|
||||
if (argc == 0 || argc > 2 ||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: fetch.c,v 1.158 2005/05/14 15:26:43 lukem Exp $ */
|
||||
/* $NetBSD: fetch.c,v 1.159 2005/05/19 03:05:04 lukem Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
|
||||
@ -41,7 +41,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: fetch.c,v 1.158 2005/05/14 15:26:43 lukem Exp $");
|
||||
__RCSID("$NetBSD: fetch.c,v 1.159 2005/05/19 03:05:04 lukem Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -1300,7 +1300,7 @@ void
|
||||
aborthttp(int notused)
|
||||
{
|
||||
char msgbuf[100];
|
||||
int len;
|
||||
size_t len;
|
||||
|
||||
sigint_raised = 1;
|
||||
alarmtimer(0);
|
||||
@ -1760,7 +1760,8 @@ int
|
||||
auto_put(int argc, char **argv, const char *uploadserver)
|
||||
{
|
||||
char *uargv[4], *path, *pathsep;
|
||||
int uargc, rval, len;
|
||||
int uargc, rval;
|
||||
size_t len;
|
||||
|
||||
uargc = 0;
|
||||
uargv[uargc++] = "mput";
|
||||
@ -1779,8 +1780,6 @@ auto_put(int argc, char **argv, const char *uploadserver)
|
||||
* make sure we always pass a directory to auto_fetch
|
||||
*/
|
||||
if (argc > 1) { /* more than one file to upload */
|
||||
int len;
|
||||
|
||||
len = strlen(uploadserver) + 2; /* path + "/" + "\0" */
|
||||
free(path);
|
||||
path = (char *)xmalloc(len);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: main.c,v 1.94 2005/05/13 05:03:49 lukem Exp $ */
|
||||
/* $NetBSD: main.c,v 1.95 2005/05/19 03:05:04 lukem Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996-2004 The NetBSD Foundation, Inc.
|
||||
@ -104,7 +104,7 @@ __COPYRIGHT("@(#) Copyright (c) 1985, 1989, 1993, 1994\n\
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: main.c,v 1.94 2005/05/13 05:03:49 lukem Exp $");
|
||||
__RCSID("$NetBSD: main.c,v 1.95 2005/05/19 03:05:04 lukem Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -143,7 +143,8 @@ main(int argc, char *argv[])
|
||||
int ch, rval;
|
||||
struct passwd *pw;
|
||||
char *cp, *ep, *anonuser, *anonpass, *upload_path;
|
||||
int dumbterm, s, len, isupload;
|
||||
int dumbterm, s, isupload;
|
||||
size_t len;
|
||||
socklen_t slen;
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
@ -630,7 +631,8 @@ cmdscanner(void)
|
||||
{
|
||||
struct cmd *c;
|
||||
char *p;
|
||||
int num;
|
||||
int ch;
|
||||
size_t num;
|
||||
|
||||
for (;;) {
|
||||
#ifndef NO_EDITCOMPLETE
|
||||
@ -658,7 +660,7 @@ cmdscanner(void)
|
||||
} else if (num == sizeof(line) - 2) {
|
||||
fputs("Sorry, input line is too long.\n",
|
||||
ttyout);
|
||||
while ((num = getchar()) != '\n' && num != EOF)
|
||||
while ((ch = getchar()) != '\n' && ch != EOF)
|
||||
/* void */;
|
||||
break;
|
||||
} /* else it was a line without a newline */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: progressbar.c,v 1.7 2005/04/11 01:49:31 lukem Exp $ */
|
||||
/* $NetBSD: progressbar.c,v 1.8 2005/05/19 03:05:04 lukem Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997-2003 The NetBSD Foundation, Inc.
|
||||
@ -38,7 +38,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: progressbar.c,v 1.7 2005/04/11 01:49:31 lukem Exp $");
|
||||
__RCSID("$NetBSD: progressbar.c,v 1.8 2005/05/19 03:05:04 lukem Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -121,7 +121,8 @@ progressmeter(int flag)
|
||||
struct timeval td;
|
||||
off_t abbrevsize, bytespersec;
|
||||
double elapsed;
|
||||
int ratio, barlength, i, remaining;
|
||||
int ratio, i, remaining;
|
||||
size_t barlength;
|
||||
|
||||
/*
|
||||
* Work variables for progress bar.
|
||||
@ -132,7 +133,7 @@ progressmeter(int flag)
|
||||
* these appropriately.
|
||||
*/
|
||||
#endif
|
||||
int len;
|
||||
size_t len;
|
||||
char buf[256]; /* workspace for progress bar */
|
||||
#ifndef NO_PROGRESS
|
||||
#define BAROVERHEAD 43 /* non `*' portion of progress bar */
|
||||
@ -296,7 +297,8 @@ ptransfer(int siginfo)
|
||||
struct timeval now, td, wait;
|
||||
double elapsed;
|
||||
off_t bytespersec;
|
||||
int remaining, hh, i, len;
|
||||
int remaining, hh, i;
|
||||
size_t len;
|
||||
|
||||
char buf[256]; /* Work variable for transfer status. */
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: util.c,v 1.124 2005/05/19 02:55:37 lukem Exp $ */
|
||||
/* $NetBSD: util.c,v 1.125 2005/05/19 03:05:04 lukem Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997-2005 The NetBSD Foundation, Inc.
|
||||
@ -71,7 +71,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: util.c,v 1.124 2005/05/19 02:55:37 lukem Exp $");
|
||||
__RCSID("$NetBSD: util.c,v 1.125 2005/05/19 03:05:04 lukem Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -427,7 +427,7 @@ ftp_login(const char *host, const char *user, const char *pass)
|
||||
|
||||
if (gatemode) {
|
||||
char *nuser;
|
||||
int len;
|
||||
size_t len;
|
||||
|
||||
len = strlen(user) + 1 + strlen(host) + 1;
|
||||
nuser = xmalloc(len);
|
||||
@ -500,8 +500,10 @@ ftp_login(const char *host, const char *user, const char *pass)
|
||||
int
|
||||
another(int *pargc, char ***pargv, const char *prompt)
|
||||
{
|
||||
int len = strlen(line), ret;
|
||||
int ret;
|
||||
size_t len;
|
||||
|
||||
len = strlen(line);
|
||||
if (len >= sizeof(line) - 3) {
|
||||
fputs("sorry, arguments too long.\n", ttyout);
|
||||
intr(0);
|
||||
@ -530,12 +532,13 @@ another(int *pargc, char ***pargv, const char *prompt)
|
||||
char *
|
||||
remglob(char *argv[], int doswitch, const char **errbuf)
|
||||
{
|
||||
char temp[MAXPATHLEN];
|
||||
static char buf[MAXPATHLEN];
|
||||
static FILE *ftemp = NULL;
|
||||
static char **args;
|
||||
int oldverbose, oldhash, oldprogress, fd, len;
|
||||
char temp[MAXPATHLEN];
|
||||
int oldverbose, oldhash, oldprogress, fd;
|
||||
char *cp, *mode;
|
||||
size_t len;
|
||||
|
||||
if (!mflag || !connected) {
|
||||
if (!doglob)
|
||||
@ -856,9 +859,10 @@ printf("file %s realfile %s dir %s [%d]\n", file, realfile, dir, dirlen);
|
||||
void
|
||||
list_vertical(StringList *sl)
|
||||
{
|
||||
int i, j, w;
|
||||
int columns, width, lines;
|
||||
int i, j;
|
||||
int columns, lines;
|
||||
char *p;
|
||||
size_t w, width;
|
||||
|
||||
width = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user