Fix segfault when read(2) returns -1

This commit is contained in:
cheusov 2011-11-05 00:17:19 +00:00
parent 4e63674fcc
commit 3e8537647d
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: md5hl.c,v 1.2 2009/06/30 02:44:52 agc Exp $ */
/* $NetBSD: md5hl.c,v 1.3 2011/11/05 00:17:19 cheusov Exp $ */
/*
* Written by Jason R. Thorpe <thorpej@netbsd.org>, April 29, 1997.
@ -18,7 +18,7 @@
#define _DIAGASSERT(cond) assert(cond)
#endif
/* $NetBSD: md5hl.c,v 1.2 2009/06/30 02:44:52 agc Exp $ */
/* $NetBSD: md5hl.c,v 1.3 2011/11/05 00:17:19 cheusov Exp $ */
/*
* ----------------------------------------------------------------------------
@ -84,7 +84,7 @@ MDNAME(File)(filename, buf)
unsigned char buffer[BUFSIZ];
MDNAME(_CTX) ctx;
int f, j;
size_t i;
ssize_t i;
_DIAGASSERT(filename != 0);
/* buf may be NULL */