From 210a92cae90deb5b4a410b1b7d5c625c5c5f2ffb Mon Sep 17 00:00:00 2001 From: Ivo Timmermans Date: Mon, 17 Apr 2000 15:38:47 +0000 Subject: [PATCH] Only one round of reading bits out of urandom; Reading `bytes' bytes out of it; Print a newline after completion. --- src/genauth.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/genauth.c b/src/genauth.c index 0d47d51..23f9770 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; } -- 2.25.1