fix off-by-one in fwrite() check in got_ref_write()
diff --git a/lib/reference.c b/lib/reference.c
index fead5a1..09760eb 100644
--- a/lib/reference.c
+++ b/lib/reference.c
@@ -744,7 +744,7 @@ got_ref_write(struct got_reference *ref, struct got_repository *repo)
goto done;
}
n = fprintf(f, "%s\n", hex);
- if (n != sizeof(hex) + 1) {
+ if (n != sizeof(hex)) {
err = got_ferror(f, GOT_ERR_IO);
goto done;
}