Make readLenType generally available. Fix some warnings around read(2).

This commit is contained in:
nhkeni
2022-03-16 18:41:45 -04:00
parent a64a666f78
commit dc72e07a2b
3 changed files with 13 additions and 6 deletions

View File

@@ -1443,7 +1443,7 @@ restore_menu(
int
validate(NHFILE* nhfp, const char *name)
{
int rlen = 0;
readLenType rlen = 0;
struct savefile_info sfi;
unsigned long utdflags = 0L;
boolean verbose = name ? TRUE : FALSE, reslt = FALSE;
@@ -1454,10 +1454,10 @@ validate(NHFILE* nhfp, const char *name)
if ((nhfp->mode & WRITING) == 0) {
if (nhfp->structlevel)
rlen = read(nhfp->fd, (genericptr_t) &sfi, sizeof sfi);
rlen = (readLenType) read(nhfp->fd, (genericptr_t) &sfi, sizeof sfi);
} else {
if (nhfp->structlevel)
rlen = read(nhfp->fd, (genericptr_t) &sfi, sizeof sfi);
rlen = (readLenType) read(nhfp->fd, (genericptr_t) &sfi, sizeof sfi);
minit(); /* ZEROCOMP */
if (rlen == 0) {
if (verbose) {