com php-src: Fix ext/ftp: ext/ftp/ftp.c
| From: | Nikita Popov | Date: | Tue, 22 Nov 2016 18:06:59 +0000 |
| Subject: | com php-src: Fix ext/ftp: ext/ftp/ftp.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-95987@lists.php.net to get a copy of this message | ||
Commit: d18741d0020933f163aa6086dbd54429b152a685
Author: Nikita Popov <nikic@php.net> Tue, 22 Nov 2016 19:06:59 +0100
Parents: 972b9e989fe40698588e0afc7934a480c94a9416
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d18741d0020933f163aa6086dbd54429b152a685
Log:
Fix ext/ftp
Changed paths:
M ext/ftp/ftp.c
Diff:
diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c
index 32b16bb..6e916f1 100644
--- a/ext/ftp/ftp.c
+++ b/ext/ftp/ftp.c
@@ -703,7 +703,7 @@ ftp_list(ftpbuf_t *ftp, const char *path, const size_t path_len, int recursive)
int
ftp_type(ftpbuf_t *ftp, ftptype_t type)
{
- char typechar[2];
+ const char *typechar;
if (ftp == NULL) {
return 0;
@@ -712,13 +712,13 @@ ftp_type(ftpbuf_t *ftp, ftptype_t type)
return 1;
}
if (type == FTPTYPE_ASCII) {
- typechar[0] = 'A';
+ typechar = "A";
} else if (type == FTPTYPE_IMAGE) {
- typechar[0] = 'I';
+ typechar = "I";
} else {
return 0;
}
- if (!ftp_putcmd(ftp, "TYPE", sizeof("TYPE")-1, typechar, 2)) {
+ if (!ftp_putcmd(ftp, "TYPE", sizeof("TYPE")-1, typechar, 1)) {
return 0;
}
if (!ftp_getresp(ftp) || ftp->resp != 200) {