commit 9e17834c0d040591851629431cdc9abe95c49684 from: Tracey Emery date: Wed Mar 23 14:04:31 2022 UTC compare to rounded integral value and clean up logic commit - 90af0b19bab6346d8472d5e126d8690192e36220 commit + 9e17834c0d040591851629431cdc9abe95c49684 blob - 205cfc95c537fb5a7a99457d1abc1f8ffb106f3c blob + c3fa0c95669d9d9974a25e3091ec8a5b9af914cf --- shreddisk.c +++ shreddisk.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -230,12 +231,11 @@ main(void) } sh_time = time(NULL); - if (percent < 100) - printf("\n\nDisk appears to have been removed.\n" - "Finished shredding %s\n", ctime(&sh_time)); - else - printf("\n\nFinished shredding %s\n", ctime(&sh_time)); + if (round(percent) < 100) + printf("\n\nDisk appears to have been removed."); + printf("\n\nFinished shredding %s\n", ctime(&sh_time)); + fclose(dd); /* re-enable cursor on finish */