Check if stdout is a terminal, if so, print a verbose message.

This commit is contained in:
Ivo Timmermans 2000-04-17 16:59:42 +00:00
parent c924689690
commit 9c2ac77594

View file

@ -72,11 +72,22 @@ int main(int argc, char **argv)
}
fclose(fp);
printf("%d ", bits);
for(i = 0; i < bytes; i++)
printf("%02x", p[i]);
puts("");
fprintf(stderr, ": done.\n");
if(isatty(1))
{
fprintf(stderr, ": done.\nThe following line should be ENTIRELY copied into a passphrase file:\n");
printf("%d ", bits);
for(i = 0; i < bytes; i++)
printf("%02x", p[i]);
puts("");
}
else
{
printf("%d ", bits);
for(i = 0; i < bytes; i++)
printf("%02x", p[i]);
puts("");
fprintf(stderr, ": done.\n");
}
return 0;
}