netutils/ftpc/ftpc_getfile.c: Appease nxstyle

This commit is contained in:
YAMAMOTO Takashi 2020-11-25 07:27:01 +09:00 committed by Xiang Xiao
parent 24b6f9199a
commit f83caca9ac

View File

@ -78,7 +78,8 @@
* *
****************************************************************************/ ****************************************************************************/
static int ftpc_recvinit(struct ftpc_session_s *session, FAR const char *path, static int ftpc_recvinit(struct ftpc_session_s *session,
FAR const char *path,
uint8_t xfrmode, off_t offset) uint8_t xfrmode, off_t offset)
{ {
int ret; int ret;
@ -180,11 +181,12 @@ static int ftpc_recvbinary(FAR struct ftpc_session_s *session,
/* Loop until the entire file is received */ /* Loop until the entire file is received */
for (;;) for (; ; )
{ {
/* Read the data from the socket */ /* Read the data from the socket */
nread = fread(session->buffer, sizeof(char), CONFIG_FTP_BUFSIZE, rinstream); nread = fread(session->buffer, sizeof(char), CONFIG_FTP_BUFSIZE,
rinstream);
if (nread <= 0) if (nread <= 0)
{ {
/* nread < 0 is an error */ /* nread < 0 is an error */
@ -234,7 +236,8 @@ static int ftpc_recvbinary(FAR struct ftpc_session_s *session,
* *
****************************************************************************/ ****************************************************************************/
int ftpc_getfile(SESSION handle, FAR const char *rname, FAR const char *lname, int ftpc_getfile(SESSION handle, FAR const char *rname,
FAR const char *lname,
uint8_t how, uint8_t xfrmode) uint8_t how, uint8_t xfrmode)
{ {
FAR struct ftpc_session_s *session = (FAR struct ftpc_session_s *)handle; FAR struct ftpc_session_s *session = (FAR struct ftpc_session_s *)handle;
@ -312,7 +315,8 @@ int ftpc_getfile(SESSION handle, FAR const char *rname, FAR const char *lname,
goto errout_with_abspath; goto errout_with_abspath;
} }
loutstream = fopen(abslpath, (offset > 0 || (how == FTPC_GET_APPEND)) ? "a" : "w"); loutstream = fopen(abslpath,
(offset > 0 || (how == FTPC_GET_APPEND)) ? "a" : "w");
if (!loutstream) if (!loutstream)
{ {
nerr("ERROR: fopen failed: %d\n", errno); nerr("ERROR: fopen failed: %d\n", errno);