Hi,

The function lreply() already calls fflush(3) on stdout.  So, this calls
are useless.

OK?

bye,
Jan

Index: ftpd.c
===================================================================
RCS file: /cvs/src/libexec/ftpd/ftpd.c,v
retrieving revision 1.229
diff -u -p -r1.229 ftpd.c
--- ftpd.c      15 Jan 2020 22:06:59 -0000      1.229
+++ ftpd.c      5 May 2021 14:39:25 -0000
@@ -568,7 +568,6 @@ main(int argc, char *argv[])
                        line[strcspn(line, "\n")] = '\0';
                        lreply(530, "%s", line);
                }
-               (void) fflush(stdout);
                (void) fclose(fp);
                reply(530, "System not available.");
                exit(0);
@@ -578,7 +577,6 @@ main(int argc, char *argv[])
                        line[strcspn(line, "\n")] = '\0';
                        lreply(220, "%s", line);
                }
-               (void) fflush(stdout);
                (void) fclose(fp);
                /* reply(220,) must follow */
        }
@@ -1078,7 +1076,6 @@ pass(char *passwd)
                        line[strcspn(line, "\n")] = '\0';
                        lreply(230, "%s", line);
                }
-               (void) fflush(stdout);
                (void) fclose(fp);
        }
        free(motd);
@@ -2029,7 +2026,6 @@ cwd(char *path)
                                line[strcspn(line, "\n")] = '\0';
                                lreply(250, "%s", line);
                        }
-                       (void) fflush(stdout);
                        (void) fclose(message);
                }
                ack("CWD");

Reply via email to