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>
pull/5/head
Michele Calgaro 3 years ago
parent c0822095d4
commit ec784ca901
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -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);

@ -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();

@ -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

@ -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);

Loading…
Cancel
Save