]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
urldata: make 'ftp_create_missing_dirs' a uchar
authorDaniel Stenberg <daniel@haxx.se>
Mon, 4 Jul 2022 21:09:15 +0000 (23:09 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 5 Jul 2022 08:10:49 +0000 (10:10 +0200)
It only ever holds the values 0-2.

Closes #9103

lib/setopt.c
lib/urldata.h

index 017ac1ae2b19ebb5d54fc6bee0eef9b47eb19942..1bb44bd91929e0d4842748fd0b3994bc492d85e4 100644 (file)
@@ -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:
     /*
index 3c2cc72b61bb600afcaee701e1412dd98d2febc9..59c2d1e114445cb8fcc5be9bc49c01f8fe8df3f7 100644 (file)
@@ -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 */