sigtool/sigtool.c: fix formatting of hash dbs (bb#2765)

remotes/push_mirror/cliemu_dump
Tomasz Kojm 14 years ago
parent 0e3d9af46f
commit 1a697e4b2e
  1. 4
      ChangeLog
  2. 5
      sigtool/sigtool.c

@ -1,3 +1,7 @@
Tue May 3 16:14:27 PDT 2011 (tk)
---------------------------------
* sigtool/sigtool.c: fix formatting of hash dbs (bb#2765)
Wed Apr 27 15:07:22 CEST 2011 (tk) Wed Apr 27 15:07:22 CEST 2011 (tk)
---------------------------------- ----------------------------------
* freshclam: add mirror statistics mechanism * freshclam: add mirror statistics mechanism

@ -45,6 +45,7 @@
#endif #endif
#include <dirent.h> #include <dirent.h>
#include <ctype.h> #include <ctype.h>
#include <libgen.h>
#ifdef HAVE_TERMIOS_H #ifdef HAVE_TERMIOS_H
#include <termios.h> #include <termios.h>
@ -170,9 +171,9 @@ static int hashsig(const struct optstruct *opts, unsigned int mdb, int type)
if((sb.st_mode & S_IFMT) == S_IFREG) { if((sb.st_mode & S_IFMT) == S_IFREG) {
if((hash = cli_hashfile(opts->filename[i], type))) { if((hash = cli_hashfile(opts->filename[i], type))) {
if(mdb) if(mdb)
mprintf("%u:%s:%s\n", (unsigned int) sb.st_size, hash, opts->filename[i]); mprintf("%u:%s:%s\n", (unsigned int) sb.st_size, hash, basename(opts->filename[i]));
else else
mprintf("%s:%u:%s\n", hash, (unsigned int) sb.st_size, opts->filename[i]); mprintf("%s:%u:%s\n", hash, (unsigned int) sb.st_size, basename(opts->filename[i]));
free(hash); free(hash);
} else { } else {
mprintf("!hashsig: Can't generate hash for %s\n", opts->filename[i]); mprintf("!hashsig: Can't generate hash for %s\n", opts->filename[i]);

Loading…
Cancel
Save