On Tue, Apr 05, 2016 at 08:22:22PM +0200, [email protected] wrote:
> Hi,
> 
> cmd is a ptr.
> 
> --f.

I am OK with it (after a small change for fit 80 cols)

> 
> Index: ftpd.c
> ===================================================================
> RCS file: /cvs/src/libexec/ftpd/ftpd.c,v
> retrieving revision 1.213
> diff -u -r1.213 ftpd.c
> --- ftpd.c    16 Mar 2016 15:41:10 -0000      1.213
> +++ ftpd.c    5 Apr 2016 18:12:20 -0000
> @@ -1151,7 +1151,7 @@
>       pid_t pid;
>       time_t start;
>  
> -     if (cmd == 0) {
> +     if (cmd == NULL) {
>               fin = fopen(name, "r");
>               st.st_size = 0;
>       } else {
> @@ -1166,14 +1166,14 @@
>       if (fin == NULL) {
>               if (errno != 0) {
>                       perror_reply(550, name);
> -                     if (cmd == 0) {
> +                     if (cmd == NULL) {
>                               LOGCMD("get", name);
>                       }
>               }
>               return;
>       }
>       byte_count = -1;
> -     if (cmd == 0 && (fstat(fileno(fin), &st) < 0 || !S_ISREG(st.st_mode))) {
> +     if (cmd == NULL && (fstat(fileno(fin), &st) < 0 || 
> !S_ISREG(st.st_mode))) {

 here -^

>               reply(550, "%s: not a plain file.", name);
>               goto done;
>       }
> @@ -1205,8 +1205,8 @@
>               goto done;
>       time(&start);
>       send_data(fin, dout, (off_t)st.st_blksize, st.st_size,
> -         (restart_point == 0 && cmd == 0 && S_ISREG(st.st_mode)));
> -     if ((cmd == 0) && stats)
> +         (restart_point == 0 && cmd == NULL && S_ISREG(st.st_mode)));
> +     if ((cmd == NULL) && stats)
>               logxfer(name, byte_count, start);
>       (void) fclose(dout);
>       data = -1;
> @@ -1214,7 +1214,7 @@
>       if (pdata >= 0)
>               (void) close(pdata);
>       pdata = -1;
> -     if (cmd == 0) {
> +     if (cmd == NULL) {
>               LOGBYTES("get", name, byte_count);
>               fclose(fin);
>       } else {
> 
> 

-- 
Sebastien Marie

Reply via email to