Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/fetch/dist/libfetch Annotate format strings. Ad...
details: https://anonhg.NetBSD.org/src/rev/6b3a5c6b9eeb
branches: trunk
changeset: 325807:6b3a5c6b9eeb
user: joerg <joerg%NetBSD.org@localhost>
date: Tue Jan 07 02:13:00 2014 +0000
description:
Annotate format strings. Add a bunch of int casts for size limits.
diffstat:
external/bsd/fetch/dist/libfetch/common.h | 4 ++--
external/bsd/fetch/dist/libfetch/ftp.c | 13 +++++++------
external/bsd/fetch/dist/libfetch/http.c | 3 ++-
3 files changed, 11 insertions(+), 9 deletions(-)
diffs (97 lines):
diff -r 725612b8bc48 -r 6b3a5c6b9eeb external/bsd/fetch/dist/libfetch/common.h
--- a/external/bsd/fetch/dist/libfetch/common.h Tue Jan 07 02:12:07 2014 +0000
+++ b/external/bsd/fetch/dist/libfetch/common.h Tue Jan 07 02:13:00 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: common.h,v 1.1.1.7 2010/03/24 20:51:42 joerg Exp $ */
+/* $NetBSD: common.h,v 1.2 2014/01/07 02:13:00 joerg Exp $ */
/*-
* Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
* All rights reserved.
@@ -90,7 +90,7 @@
void fetch_seterr(struct fetcherr *, int);
void fetch_syserr(void);
-void fetch_info(const char *, ...);
+void fetch_info(const char *, ...) __printflike(1, 2);
int fetch_default_port(const char *);
int fetch_default_proxy_port(const char *);
int fetch_bind(int, int, const char *);
diff -r 725612b8bc48 -r 6b3a5c6b9eeb external/bsd/fetch/dist/libfetch/ftp.c
--- a/external/bsd/fetch/dist/libfetch/ftp.c Tue Jan 07 02:12:07 2014 +0000
+++ b/external/bsd/fetch/dist/libfetch/ftp.c Tue Jan 07 02:13:00 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ftp.c,v 1.6 2013/10/19 22:58:40 mrg Exp $ */
+/* $NetBSD: ftp.c,v 1.7 2014/01/07 02:13:00 joerg Exp $ */
/*-
* Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
* Copyright (c) 2008, 2009, 2010 Joerg Sonnenberger <joerg%NetBSD.org@localhost>
@@ -198,6 +198,7 @@
/*
* Send a command and check reply
*/
+__printflike(2, 3)
static int
ftp_cmd(conn_t *conn, const char *fmt, ...)
{
@@ -391,7 +392,7 @@
++beg, ++i;
for (++i; dst + i < end && dst[i] != '/'; ++i)
/* nothing */ ;
- e = ftp_cmd(conn, "CWD %.*s\r\n", dst + i - beg, beg);
+ e = ftp_cmd(conn, "CWD %.*s\r\n", (int)(dst + i - beg), beg);
if (e != FTP_FILE_ACTION_OK) {
free(dst);
ftp_seterr(e);
@@ -489,7 +490,7 @@
return (-1);
}
- e = ftp_cmd(conn, "SIZE %.*s\r\n", filenamelen, filename);
+ e = ftp_cmd(conn, "SIZE %.*s\r\n", (int)filenamelen, filename);
if (e != FTP_FILE_STATUS) {
ftp_seterr(e);
return (-1);
@@ -506,7 +507,7 @@
if (us->size == 0)
us->size = -1;
- e = ftp_cmd(conn, "MDTM %.*s\r\n", filenamelen, filename);
+ e = ftp_cmd(conn, "MDTM %.*s\r\n", (int)filenamelen, filename);
if (e != FTP_FILE_STATUS) {
ftp_seterr(e);
return (-1);
@@ -851,7 +852,7 @@
e = ftp_cmd(conn, "%s%s%s\r\n", oper, *op_arg ? " " : "", op_arg);
else
e = ftp_cmd(conn, "%s %.*s\r\n", oper,
- filenamelen, filename);
+ (int)filenamelen, filename);
if (e != FTP_CONNECTION_ALREADY_OPEN && e != FTP_OPEN_DATA_CONNECTION)
goto ouch;
@@ -948,7 +949,7 @@
e = ftp_cmd(conn, "%s%s%s\r\n", oper, *op_arg ? " " : "", op_arg);
else
e = ftp_cmd(conn, "%s %.*s\r\n", oper,
- filenamelen, filename);
+ (int)filenamelen, filename);
if (e != FTP_CONNECTION_ALREADY_OPEN && e != FTP_OPEN_DATA_CONNECTION)
goto ouch;
diff -r 725612b8bc48 -r 6b3a5c6b9eeb external/bsd/fetch/dist/libfetch/http.c
--- a/external/bsd/fetch/dist/libfetch/http.c Tue Jan 07 02:12:07 2014 +0000
+++ b/external/bsd/fetch/dist/libfetch/http.c Tue Jan 07 02:13:00 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: http.c,v 1.2 2011/06/25 20:27:01 christos Exp $ */
+/* $NetBSD: http.c,v 1.3 2014/01/07 02:13:00 joerg Exp $ */
/*-
* Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav
* Copyright (c) 2003 Thomas Klausner <wiz%NetBSD.org@localhost>
@@ -404,6 +404,7 @@
/*
* Send a formatted line; optionally echo to terminal
*/
+__printflike(2, 3)
static int
http_cmd(conn_t *conn, const char *fmt, ...)
{
Home |
Main Index |
Thread Index |
Old Index