aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2020-02-01 01:33:09 +1300
committerTom Ryder <tom@sanctum.geek.nz>2020-02-01 01:33:09 +1300
commit90498a10794218213d6aa978a6dd93cd8d50808c (patch)
tree20831bc60949e8da725d9b6932da743619963841
parentc4b4ac4c075d498c2ca3606ee920407a4d556b52 (diff)
downloadcrypt-90498a10794218213d6aa978a6dd93cd8d50808c.tar.gz
crypt-90498a10794218213d6aa978a6dd93cd8d50808c.zip
Check zero print
-rw-r--r--crypt.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypt.c b/crypt.c
index 592869e..48c8bd2 100644
--- a/crypt.c
+++ b/crypt.c
@@ -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");
}