Fix compilation in ftp.c
When trying to compile the file ftp.c, I get errors related with warnings that were marked to be reported as error. This was the original message: ``` fetch/ftp.c:444:8: error: this statement may fall through [-Werror=implicit-fallthrough=] type = 'D'; ~~~~~^~~~~ fetch/ftp.c:445:2: note: here case 'D': ^~~~ fetch/ftp.c: In function ‘ftp_request’: fetch/ftp.c:342:3: error: missed loop optimization, the loop counter may overflow [-Werror=unsafe-loop-optimizations] for (i = 0; i <= len && i <= end - dst; ++i) ^~~ fetch/ftp.c:342:24: error: missed loop optimization, the loop counter may overflow [-Werror=unsafe-loop-optimizations] for (i = 0; i <= len && i <= end - dst; ++i) ~~~~~~~~~^~~~~~~~~~~~~~~~~ ```
This commit is contained in:
parent
876f9f4a27
commit
be5277591f
@ -339,7 +339,7 @@ ftp_cwd(conn_t *conn, const char *path, int subdir)
|
|||||||
len = strlen(pwd);
|
len = strlen(pwd);
|
||||||
|
|
||||||
/* Look for a common prefix between PWD and dir to fetch. */
|
/* Look for a common prefix between PWD and dir to fetch. */
|
||||||
for (i = 0; i <= len && i <= end - dst; ++i)
|
for (i = 0; i < len && i < end - dst; ++i)
|
||||||
if (pwd[i] != dst[i])
|
if (pwd[i] != dst[i])
|
||||||
break;
|
break;
|
||||||
/* Keep going up a dir until we have a matching prefix. */
|
/* Keep going up a dir until we have a matching prefix. */
|
||||||
@ -440,10 +440,6 @@ ftp_mode_type(conn_t *conn, int mode, int type)
|
|||||||
type = 'A';
|
type = 'A';
|
||||||
case 'A':
|
case 'A':
|
||||||
break;
|
break;
|
||||||
case 'd':
|
|
||||||
type = 'D';
|
|
||||||
case 'D':
|
|
||||||
/* can't handle yet */
|
|
||||||
default:
|
default:
|
||||||
return (FTP_PROTOCOL_ERROR);
|
return (FTP_PROTOCOL_ERROR);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user