bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: David Binderman
Subject: tar-1.33/src/buffer.c:1733:redundantAssignment
Date: Fri, 8 Jan 2021 16:14:53 +0000

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|S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH;
      st.stat.st_uid = getuid ();
      st.stat.st_gid = getgid ();
      st.orig_file_name = xheader_format_name (&st,
                                               "%d/GNUFileParts/%f.%n",
                                               volno);
      st.file_name = st.orig_file_name;
      st.archive_file_size = st.stat.st_size = map->sizeleft;

I suggest the code could do with a minor tidy up. When
initialising fields, I usually like to do it in alfabetic order,
or in the order in the definition.

Regards

David Binderman



reply via email to

[Prev in Thread] Current Thread [Next in Thread]