bug-fileutils
[Top][All Lists]
Advanced

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

fileutils-4.0: wrong arg count in error() call in copy_internal()


From: Per Cederqvist
Subject: fileutils-4.0: wrong arg count in error() call in copy_internal()
Date: 28 Feb 2001 21:45:26 +0100

The format string supplied to error() in the code below has three "%s"
formats, but only receives two arguments.  This triggered a core dump
under Solaris 7.

This code is from copy_internal() in src/copy.c around line 606 in
fileutils-4.0.

      /* Avoid damaging the destination filesystem by refusing to preserve
         hard-linked directories (which are found at least in Netapp snapshot
         directories).  */
      if (S_ISDIR (src_type))
        {
          error (0, 0, _("%s: won't create hard link `%s' to directory `%s'"),
                 dst_path, earlier_file);
          goto un_backup;
        }

Info the texinfo manual tells me to include:

Version number: fileutils 4.0
Machine architecture: sparc
Repeat by: 

$ touch a b c
$ mkdir d
$ mv a b d c d
mv: d/d/a: won't create hard link `d/d' to directory `Segmentation Fault (core 
dumped)

I expected an error message, not half an error message and a core
dump.  (Actually, the "repeat by" is a simplification of what I did
type.  I didn't expect an error message, but I did deserve one for
giving such a stupid command.  Maybe I even deserved to get a core
dump. :-)

                /ceder



reply via email to

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