From 671cc8e1103e6fba47fdb6a6a21099a149eae6e7 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 4 Jul 2022 23:09:15 +0200 Subject: [PATCH] urldata: make 'ftp_create_missing_dirs' a uchar It only ever holds the values 0-2. Closes #9103 --- lib/setopt.c | 2 +- lib/urldata.h | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/setopt.c b/lib/setopt.c index 017ac1ae2b..1bb44bd919 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -1342,7 +1342,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) (arg > CURLFTP_CREATE_DIR_RETRY)) result = CURLE_BAD_FUNCTION_ARGUMENT; else - data->set.ftp_create_missing_dirs = (int)arg; + data->set.ftp_create_missing_dirs = (unsigned char)arg; break; case CURLOPT_READDATA: /* diff --git a/lib/urldata.h b/lib/urldata.h index 3c2cc72b61..59c2d1e114 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -1758,9 +1758,11 @@ struct UserDefined { curl_ftpccc ftp_ccc; /* FTP CCC options */ long accepttimeout; /* in milliseconds, 0 means no timeout */ #endif - int ftp_create_missing_dirs; /* 1 - create directories that don't exist - 2 - the same but also allow MKD to fail once - */ + /* Desppie the name ftp_create_missing_dirs is for FTP(S) and SFTP + 1 - create directories that don't exist + 2 - the same but also allow MKD to fail once + */ + unsigned char ftp_create_missing_dirs; #ifdef USE_LIBSSH2 curl_sshhostkeycallback ssh_hostkeyfunc; /* hostkey check callback */ void *ssh_hostkeyfunc_userp; /* custom pointer to callback */