Skip to content

Commit d18741d

Browse files
committed
Fix ext/ftp
1 parent 972b9e9 commit d18741d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/ftp/ftp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ ftp_list(ftpbuf_t *ftp, const char *path, const size_t path_len, int recursive)
703703
int
704704
ftp_type(ftpbuf_t *ftp, ftptype_t type)
705705
{
706-
char typechar[2];
706+
const char *typechar;
707707

708708
if (ftp == NULL) {
709709
return 0;
@@ -712,13 +712,13 @@ ftp_type(ftpbuf_t *ftp, ftptype_t type)
712712
return 1;
713713
}
714714
if (type == FTPTYPE_ASCII) {
715-
typechar[0] = 'A';
715+
typechar = "A";
716716
} else if (type == FTPTYPE_IMAGE) {
717-
typechar[0] = 'I';
717+
typechar = "I";
718718
} else {
719719
return 0;
720720
}
721-
if (!ftp_putcmd(ftp, "TYPE", sizeof("TYPE")-1, typechar, 2)) {
721+
if (!ftp_putcmd(ftp, "TYPE", sizeof("TYPE")-1, typechar, 1)) {
722722
return 0;
723723
}
724724
if (!ftp_getresp(ftp) || ftp->resp != 200) {

0 commit comments

Comments
 (0)