Commit Diff


commit - 32cd4d1816c0cd50311db3e738fff5b19a163f7f
commit + 1ab830c1f6d0bac77a2fc49ae92847c0870dd433
blob - 5e2390dc27ee9d25dfa8e9d59d6897943fa90006
blob + f6c445d7fd8f36255e4137a355b312bee899f98c
--- gotweb/gotweb.c
+++ gotweb/gotweb.c
@@ -1446,7 +1446,7 @@ gw_get_repo_description(char **description, struct gw_
 	FILE *f = NULL;
 	char *d_file = NULL;
 	unsigned int len;
-	ssize_t n;
+	size_t n;
 
 	*description = NULL;
 	if (gw_trans->gw_conf->got_show_repo_description == 0)
@@ -1483,10 +1483,8 @@ gw_get_repo_description(char **description, struct gw_
 	}
 
 	n = fread(*description, 1, len, f);
-	if (n == -1) {
+	if (n == 0 && ferror(f))
 		error = got_ferror(f, GOT_ERR_IO);
-		goto done;
-	}
 done:
 	if (f != NULL && fclose(f) == -1 && error == NULL)
 		error = got_error_from_errno("fclose");