projects
/
skeinsum.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Yet another magic number replaced to calculated value.
[skeinsum.git]
/
skein_cli.c
diff --git
a/skein_cli.c
b/skein_cli.c
index f2bc2e27caeec23d8e638d239ae83161d20e8c86..220809768a12a5ec51ca78806adc39ec201b4a1f 100644
(file)
--- a/
skein_cli.c
+++ b/
skein_cli.c
@@
-233,7
+233,8
@@
int HashMatch(const char StoredDigest[], const char *filename, int quiet)
int VerifyHashesFromFile(FILE *fp, int status, int warn, int quiet)
{
int VerifyHashesFromFile(FILE *fp, int status, int warn, int quiet)
{
- char hash[500], MsgDigest_tmp[hashbitlen/2];
+ char hash[PATH_MAX + hashbitlen/4 + 4];
+ char MsgDigest_tmp[hashbitlen/2];
int NoMatch = 0, NotProper = 0, Computed = 0;
int line = 0;
int NoMatch = 0, NotProper = 0, Computed = 0;
int line = 0;
@@
-419,7
+420,7
@@
void print_usage(void)
exit(1);
}
exit(1);
}
-int is_goodfile(const char filename[]
, int verbose
)
+int is_goodfile(const char filename[])
{
if (!strcmp(filename, "-"))
return 1;
{
if (!strcmp(filename, "-"))
return 1;
@@
-427,7
+428,7
@@
int is_goodfile(const char filename[], int verbose)
struct stat s;
if (stat(filename, &s) < 0) {
struct stat s;
if (stat(filename, &s) < 0) {
-
if (verbose)
fprintf(stderr, "skein%dsum: %s: no such file or directory\n", hashbitlen, filename);
+ fprintf(stderr, "skein%dsum: %s: no such file or directory\n", hashbitlen, filename);
return 0;
}
return 0;
}
@@
-435,7
+436,7
@@
int is_goodfile(const char filename[], int verbose)
return 1;
if (s.st_mode & S_IFDIR) {
return 1;
if (s.st_mode & S_IFDIR) {
-
if (verbose)
fprintf(stderr, "skein%dsum: %s: is a directory\n", hashbitlen, filename);
+ fprintf(stderr, "skein%dsum: %s: is a directory\n", hashbitlen, filename);
return 0;
}
return 0;
}
@@
-503,7
+504,7
@@
int main(int argc, char** argv)
for (file_index = first_file; file_index < argc; file_index++)
{
const char *filename = argv[file_index];
for (file_index = first_file; file_index < argc; file_index++)
{
const char *filename = argv[file_index];
- if (!is_goodfile(filename
, 1
)) {
+ if (!is_goodfile(filename)) {
errorFound++;
continue;
}
errorFound++;
continue;
}
@@
-540,7
+541,7
@@
int main(int argc, char** argv)
for (file_index = first_file; file_index < argc; file_index++)
{
const char *filename = argv[file_index];
for (file_index = first_file; file_index < argc; file_index++)
{
const char *filename = argv[file_index];
- if (!is_goodfile(filename
, 1
)) {
+ if (!is_goodfile(filename)) {
errorFound++;
continue;
}
errorFound++;
continue;
}