From 2a3f2ea8c6cebf6fca3f4c6e37ed5affce5884e5 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 25 Nov 2020 07:29:18 +0900 Subject: [PATCH] netutils/ftpc/ftpc_putfile.c: Appease nxstyle --- netutils/ftpc/ftpc_putfile.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/netutils/ftpc/ftpc_putfile.c b/netutils/ftpc/ftpc_putfile.c index b138146f4..17bde8ad0 100644 --- a/netutils/ftpc/ftpc_putfile.c +++ b/netutils/ftpc/ftpc_putfile.c @@ -87,11 +87,12 @@ static int ftpc_sendbinary(FAR struct ftpc_session_s *session, /* Loop until the entire file is sent */ - for (;;) + for (; ; ) { /* Read data from the file */ - nread = fread(session->buffer, sizeof(char), CONFIG_FTP_BUFSIZE, linstream); + nread = fread(session->buffer, sizeof(char), CONFIG_FTP_BUFSIZE, + linstream); if (nread <= 0) { /* nread == 0 is just EOF */ @@ -271,13 +272,14 @@ static int ftpc_sendfile(struct ftpc_session_s *session, const char *path, { if (*str == '\'') { - rname = strndup(str+1, len-3); + rname = strndup(str + 1, len - 3); } else { - rname = strndup(str, len-1); + rname = strndup(str, len - 1); ninfo("Unique filename is: %s\n", rname); } + free(rname); } }