Skip to content

Commit

Permalink
write_in_full: size_t is unsigned.
Browse files Browse the repository at this point in the history
It received the return value from xwrite() in a size_t variable
'written' and expected comparison with 0 would catch an error
from xwrite().

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Jan 27, 2007
1 parent 8a56da2 commit d848804
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion write_or_die.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int write_in_full(int fd, const void *buf, size_t count)
ssize_t total = 0;

while (count > 0) {
size_t written = xwrite(fd, p, count);
ssize_t written = xwrite(fd, p, count);
if (written < 0)
return -1;
if (!written) {
Expand Down

0 comments on commit d848804

Please sign in to comment.