Only one round of reading bits out of urandom;
Reading `bytes' bytes out of it; Print a newline after completion.
This commit is contained in:
parent
5b44b91eb4
commit
210a92cae9
1 changed files with 2 additions and 12 deletions
|
@ -60,18 +60,7 @@ int main(int argc, char **argv)
|
||||||
p = xmalloc(bytes);
|
p = xmalloc(bytes);
|
||||||
|
|
||||||
setbuf(stdout, NULL);
|
setbuf(stdout, NULL);
|
||||||
for(i = 0; i < 128; i++)
|
for(i = 0; i < bytes; i++)
|
||||||
{
|
|
||||||
c = fgetc(fp);
|
|
||||||
if(feof(fp))
|
|
||||||
{
|
|
||||||
puts("");
|
|
||||||
fprintf(stderr, "File was empty!\n");
|
|
||||||
}
|
|
||||||
p[i] = c;
|
|
||||||
}
|
|
||||||
|
|
||||||
for(i = 0; i < (bytes); i++)
|
|
||||||
{
|
{
|
||||||
c = fgetc(fp);
|
c = fgetc(fp);
|
||||||
if(feof(fp))
|
if(feof(fp))
|
||||||
|
@ -87,6 +76,7 @@ int main(int argc, char **argv)
|
||||||
for(i = 0; i < bytes; i++)
|
for(i = 0; i < bytes; i++)
|
||||||
printf("%02x", p[i]);
|
printf("%02x", p[i]);
|
||||||
puts("");
|
puts("");
|
||||||
|
fprintf(stderr, ": done.\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue