From b2a68600327265221a1dc8fcda70f1cb0a2de508 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Fri, 12 Dec 2014 19:02:37 +0000 Subject: [PATCH] Reading from NUL changed to report 0 bytes read. Prevents infinite read loops on NUL. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3875 --- src/dos/dos_devices.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/dos/dos_devices.cpp b/src/dos/dos_devices.cpp index 79d00eae..1936fe10 100644 --- a/src/dos/dos_devices.cpp +++ b/src/dos/dos_devices.cpp @@ -37,8 +37,7 @@ class device_NUL : public DOS_Device { public: device_NUL() { SetName("NUL"); }; virtual bool Read(Bit8u * data,Bit16u * size) { - for(Bitu i = 0; i < *size;i++) - data[i]=0; + *size = 0; //Return success and no data read. LOG(LOG_IOCTL,LOG_NORMAL)("%s:READ",GetName()); return true; }