diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2016-07-22 03:47:37 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2016-07-22 03:47:37 +0000 |
commit | a14de240858d71d914e195664735d24462601579 (patch) | |
tree | 52abb7782765c93a45f95fbf069d6fcf0abf00dd /usr.bin/ssh | |
parent | 71d87052bda47d3b577df558d9b9a55ad173e616 (diff) |
constify a few functions' arguments; patch from Jakub Jelen bz#2581
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r-- | usr.bin/ssh/sftp.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/usr.bin/ssh/sftp.c b/usr.bin/ssh/sftp.c index daeb6784d10..938e4eba9bb 100644 --- a/usr.bin/ssh/sftp.c +++ b/usr.bin/ssh/sftp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp.c,v 1.174 2016/05/25 23:48:45 schwarze Exp $ */ +/* $OpenBSD: sftp.c,v 1.175 2016/07/22 03:47:36 djm Exp $ */ /* * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> * @@ -315,7 +315,7 @@ local_do_ls(const char *args) /* Strip one path (usually the pwd) from the start of another */ static char * -path_strip(char *path, char *strip) +path_strip(const char *path, const char *strip) { size_t len; @@ -333,7 +333,7 @@ path_strip(char *path, char *strip) } static char * -make_absolute(char *p, char *pwd) +make_absolute(char *p, const char *pwd) { char *abs_str; @@ -531,7 +531,7 @@ parse_no_flags(const char *cmd, char **argv, int argc) } static int -is_dir(char *path) +is_dir(const char *path) { struct stat sb; @@ -543,7 +543,7 @@ is_dir(char *path) } static int -remote_is_dir(struct sftp_conn *conn, char *path) +remote_is_dir(struct sftp_conn *conn, const char *path) { Attrib *a; @@ -557,7 +557,7 @@ remote_is_dir(struct sftp_conn *conn, char *path) /* Check whether path returned from glob(..., GLOB_MARK, ...) is a directory */ static int -pathname_is_dir(char *pathname) +pathname_is_dir(const char *pathname) { size_t l = strlen(pathname); @@ -565,8 +565,8 @@ pathname_is_dir(char *pathname) } static int -process_get(struct sftp_conn *conn, char *src, char *dst, char *pwd, - int pflag, int rflag, int resume, int fflag) +process_get(struct sftp_conn *conn, const char *src, const char *dst, + const char *pwd, int pflag, int rflag, int resume, int fflag) { char *abs_src = NULL; char *abs_dst = NULL; @@ -651,8 +651,8 @@ out: } static int -process_put(struct sftp_conn *conn, char *src, char *dst, char *pwd, - int pflag, int rflag, int resume, int fflag) +process_put(struct sftp_conn *conn, const char *src, const char *dst, + const char *pwd, int pflag, int rflag, int resume, int fflag) { char *tmp_dst = NULL; char *abs_dst = NULL; @@ -762,7 +762,8 @@ sdirent_comp(const void *aa, const void *bb) /* sftp ls.1 replacement for directories */ static int -do_ls_dir(struct sftp_conn *conn, char *path, char *strip_path, int lflag) +do_ls_dir(struct sftp_conn *conn, const char *path, + const char *strip_path, int lflag) { int n; u_int c = 1, colspace = 0, columns = 1; @@ -847,8 +848,8 @@ do_ls_dir(struct sftp_conn *conn, char *path, char *strip_path, int lflag) /* sftp ls.1 replacement which handles path globs */ static int -do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path, - int lflag) +do_globbed_ls(struct sftp_conn *conn, const char *path, + const char *strip_path, int lflag) { char *fname, *lname; glob_t g; @@ -932,7 +933,7 @@ do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path, } static int -do_df(struct sftp_conn *conn, char *path, int hflag, int iflag) +do_df(struct sftp_conn *conn, const char *path, int hflag, int iflag) { struct sftp_statvfs st; char s_used[FMT_SCALED_STRSIZE]; |