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
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
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
Hi David,
Thanks for noticing. I have installed the following patch:
http://git.savannah.gnu.org/cgit/tar.git/commit/?id=e4d1edadefdeefcca3b72ec32744c52020fe4642
Regards,
Sergey
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
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