From: Ivo Timmermans Date: Mon, 17 Apr 2000 15:38:47 +0000 (+0000) Subject: Only one round of reading bits out of urandom; X-Git-Tag: release-1.0pre1~95 X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=commitdiff_plain;h=210a92cae90deb5b4a410b1b7d5c625c5c5f2ffb Only one round of reading bits out of urandom; Reading `bytes' bytes out of it; Print a newline after completion. --- diff --git a/src/genauth.c b/src/genauth.c index 0d47d510..23f9770a 100644 --- a/src/genauth.c +++ b/src/genauth.c @@ -60,7 +60,7 @@ int main(int argc, char **argv) p = xmalloc(bytes); setbuf(stdout, NULL); - for(i = 0; i < 128; i++) + for(i = 0; i < bytes; i++) { c = fgetc(fp); if(feof(fp)) @@ -70,23 +70,13 @@ int main(int argc, char **argv) } 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(""); + fprintf(stderr, ": done.\n"); return 0; }