projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Check for an illegal length of passphrase in read_passphrase().
[tinc]
/
src
/
genauth.c
diff --git
a/src/genauth.c
b/src/genauth.c
index
0d47d51
..
23f9770
100644
(file)
--- a/
src/genauth.c
+++ b/
src/genauth.c
@@
-60,7
+60,7
@@
int main(int argc, char **argv)
p = xmalloc(bytes);
setbuf(stdout, NULL);
p = xmalloc(bytes);
setbuf(stdout, NULL);
- for(i = 0; i <
128
; i++)
+ for(i = 0; i <
bytes
; i++)
{
c = fgetc(fp);
if(feof(fp))
{
c = fgetc(fp);
if(feof(fp))
@@
-70,23
+70,13
@@
int main(int argc, char **argv)
}
p[i] = c;
}
}
p[i] = c;
}
-
- for(i = 0; i < (bytes); i++)
- {
- c = fgetc(fp);
- if(feof(fp))
- {
- puts("");
- fprintf(stderr, "File was empty!\n");
- }
- p[i] = c;
- }
fclose(fp);
printf("%d ", bits);
for(i = 0; i < bytes; i++)
printf("%02x", p[i]);
puts("");
fclose(fp);
printf("%d ", bits);
for(i = 0; i < bytes; i++)
printf("%02x", p[i]);
puts("");
+ fprintf(stderr, ": done.\n");
return 0;
}
return 0;
}