memset(buffer, FILLCHAR, len);
XP_MEMSET(buffer, FILLCHAR, len);
static REGERR nr_ReadFile(FILEHANDLE fh, REGOFF offset, int32 len, void *buffer){#if VERIFY_READ    #define        FILLCHAR  0xCC    unsigned char* p;    unsigned char* dbgend = (unsigned char*)buffer+len;#endif    int32 readlen;	REGERR err = REGERR_OK;	XP_ASSERT(len > 0);	XP_ASSERT(buffer != NULL);	XP_ASSERT(fh != NULL);#if VERIFY_READ    memset(buffer, FILLCHAR, len);#endif	if (XP_FileSeek(fh, offset, SEEK_SET) != 0 ) {        err = REGERR_FAIL;    }    else {        readlen = XP_FileRead(buffer, len, fh );        /* PR_READ() returns an unreliable length, check EOF separately */	    if (readlen < 0) {#if !defined(STANDALONE_REGISTRY) || !defined(XP_MAC)	#if defined(STANDALONE_REGISTRY)    		if (errno == EBADF)	/* bad file handle, not open for read, etc. */	#else   			if (PR_GetError() == PR_BAD_DESCRIPTOR_ERROR)	#endif			    err = REGERR_FAIL;		    else#endif    			err = REGERR_BADREAD;    	}        else if (readlen < len) {#if VERIFY_READ            /* PR_READ() says we hit EOF but return length is unreliable. */            /* If buffer has new data beyond what PR_READ() says it got */            /* we'll assume the read was OK--this is a gamble but */            /* missing errors will cause fewer problems than too many. */            p = (unsigned char*)buffer+readlen;            while ( (*p == (unsigned char)FILLCHAR) && (p < dbgend) ) {                p++;            }            /* really was EOF if it's all FILLCHAR's */            if ( p == dbgend ) {                err = REGERR_BADREAD;            }#else            err = REGERR_BADREAD;#endif        }    }    return err;}   /* ReadFile */