summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2021-09-17 09:54:45 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2021-09-17 10:06:59 +0900
commite8ebbd20b32271fffc51ca764e6d3419b58f343d (patch)
tree953cc33f29a5396b54aabedca21d2b1cd36fda91
parenta9360ae6833bd5e95d36e0b62767725a121f4198 (diff)
downloadkftpgrabber-e8ebbd20b32271fffc51ca764e6d3419b58f343d.tar.gz
kftpgrabber-e8ebbd20b32271fffc51ca764e6d3419b58f343d.zip
Get rid of warning 'ISO C++11 does not allow conversion from string literal to char *' in sftp_canonicalize_path
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit ec784ca9013d622dc027b273d0ee2c82883dca34)
-rw-r--r--kftpgrabber/src/misc/libs/ssh/libssh.h2
-rw-r--r--kftpgrabber/src/misc/libs/ssh/sftp.c2
-rw-r--r--kftpgrabber/src/misc/libs/ssh/sftp.h2
-rw-r--r--kftpgrabber/src/misc/libs/ssh/string.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/kftpgrabber/src/misc/libs/ssh/libssh.h b/kftpgrabber/src/misc/libs/ssh/libssh.h
index 81c586d..ae36acc 100644
--- a/kftpgrabber/src/misc/libs/ssh/libssh.h
+++ b/kftpgrabber/src/misc/libs/ssh/libssh.h
@@ -103,7 +103,7 @@ const char *ssh_copyright();
/* You can use these functions, they won't change */
/* makestring returns a newly allocated string from a char * ptr */
-STRING *string_from_char(char *what);
+STRING *string_from_char(const char *what);
/* it returns the string len in host byte orders. str->size is big endian warning ! */
int string_len(STRING *str);
STRING *string_new(u32 size);
diff --git a/kftpgrabber/src/misc/libs/ssh/sftp.c b/kftpgrabber/src/misc/libs/ssh/sftp.c
index 9895456..acbe1d6 100644
--- a/kftpgrabber/src/misc/libs/ssh/sftp.c
+++ b/kftpgrabber/src/misc/libs/ssh/sftp.c
@@ -1161,7 +1161,7 @@ int sftp_setstat(SFTP_SESSION *sftp, char *file, SFTP_ATTRIBUTES *attr) {
}
/* another code written by Nick */
-char *sftp_canonicalize_path(SFTP_SESSION *sftp, char *path)
+char *sftp_canonicalize_path(SFTP_SESSION *sftp, const char *path)
{
u32 id = sftp_get_new_id(sftp);
BUFFER *buffer = buffer_new();
diff --git a/kftpgrabber/src/misc/libs/ssh/sftp.h b/kftpgrabber/src/misc/libs/ssh/sftp.h
index 10334ab..3da2d6a 100644
--- a/kftpgrabber/src/misc/libs/ssh/sftp.h
+++ b/kftpgrabber/src/misc/libs/ssh/sftp.h
@@ -136,7 +136,7 @@ int sftp_rmdir(SFTP_SESSION *sftp, char *directory);
int sftp_mkdir(SFTP_SESSION *sftp, char *directory, SFTP_ATTRIBUTES *attr);
int sftp_rename(SFTP_SESSION *sftp, char *original, char *newname);
int sftp_setstat(SFTP_SESSION *sftp, char *file, SFTP_ATTRIBUTES *attr);
-char *sftp_canonicalize_path(SFTP_SESSION *sftp, char *path);
+char *sftp_canonicalize_path(SFTP_SESSION *sftp, const char *path);
/* SFTP commands and constants */
#define SSH_FXP_INIT 1
diff --git a/kftpgrabber/src/misc/libs/ssh/string.c b/kftpgrabber/src/misc/libs/ssh/string.c
index 1126e7a..a68bc5a 100644
--- a/kftpgrabber/src/misc/libs/ssh/string.c
+++ b/kftpgrabber/src/misc/libs/ssh/string.c
@@ -36,7 +36,7 @@ void string_fill(STRING *str,void *data,int len){
memcpy(str->string,data,len);
}
-STRING *string_from_char(char *what){
+STRING *string_from_char(const char *what){
STRING *ptr;
int len=strlen(what);
ptr=malloc(4 + len);