Re: tar-1.33/src/buffer.c:1733:redundantAssignment

2021-01-08 Thread David Binderman
Hello there,   >> tar-1.33/src/buffer.c:1733:25: style: Variable 'st.orig_file_name' is >> reassigned a value before the old one >has been used. [redundantAssignment] >As a matter of fact, its value *is* used before reasignment.  By >xheader_format_name. Agreed. The static analyser tool cppchec

Re: tar-1.33/src/buffer.c:1733:redundantAssignment

2021-01-08 Thread Sergey Poznyakoff
David Binderman ha escrit: > tar-1.33/src/buffer.c:1733:25: style: Variable 'st.orig_file_name' is > reassigned a value before the old one has been used. [redundantAssignment] As a matter of fact, its value *is* used before reasignment. By xheader_format_name. Regards, Sergey

tar-1.33/src/buffer.c:1733:redundantAssignment

2021-01-08 Thread David Binderman
Hello there, tar-1.33/src/buffer.c:1733:25: style: Variable 'st.orig_file_name' is reassigned a value before the old one has been used. [redundantAssignment] Source code is memset (&st, 0, sizeof st); st.orig_file_name = st.file_name = map->file_name; st.stat.st_mode = S_IFREG

Re: tar-1.33 bug report

2021-01-08 Thread Sergey Poznyakoff
Hi David, Thanks for noticing. I have installed the following patch: http://git.savannah.gnu.org/cgit/tar.git/commit/?id=e4d1edadefdeefcca3b72ec32744c52020fe4642 Regards, Sergey

Aw: tar-1.33 bug report

2021-01-08 Thread Marius Spix
Hello David,   that statement is correct. The file descriptor of /dev/full is not needed. It is just to assure that fd 0, 1 and 2 are in use. This is an interesting way to implement a state machine abusing the C relational operator == and the return values of the open() function, which always ret

tar-1.33 bug report

2021-01-08 Thread David Binderman
Hello there, tar-1.33/lib/stdopen.c:63:22: style: Suspicious condition Source code is if (mode == O_RDONLY || (new_fd = open ("/dev/full", mode) != fd)) Maybe better code: if (mode == O_RDONLY || ((new_fd = open ("/dev/full", mode