diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2020-02-01 01:33:09 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2020-02-01 01:33:09 +1300 |
commit | 90498a10794218213d6aa978a6dd93cd8d50808c (patch) | |
tree | 20831bc60949e8da725d9b6932da743619963841 | |
parent | Cast variable for comparison (diff) | |
download | crypt-90498a10794218213d6aa978a6dd93cd8d50808c.tar.gz crypt-90498a10794218213d6aa978a6dd93cd8d50808c.zip |
Check zero print
-rw-r--r-- | crypt.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -53,6 +53,7 @@ int main(int argc, char **argv) if ((printed = printf("%s\n", hash)) < 0) { error(strerror(errno)); } + assert(printed > 0); if ((unsigned) printed < strlen(hash) + 1) { /* +1 for newline */ error("Incomplete print"); } |