From: Ian Abbott Date: Thu, 10 May 2012 12:49:57 +0000 (+0100) Subject: demo/python/mmap.py: Fix buffer wraparound bug. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ac090c7bdfcaab4c741c5100a18d93b336694305;p=comedilib.git demo/python/mmap.py: Fix buffer wraparound bug. Fix bug reported by Ross Williamson where the code does not deal with buffer wraparound within a chunk of data. --- diff --git a/demo/python/mmap.py b/demo/python/mmap.py index 65f9f82..07652ba 100755 --- a/demo/python/mmap.py +++ b/demo/python/mmap.py @@ -185,6 +185,8 @@ while flag: map.seek(back%size) for i in range(back,front,2): DATA.fromstring(map.read(2)) + if map.tell() == size: + map.seek(0) DATA.tofile(of) # append data to log file ## time.sleep(.01) ret = c.comedi_mark_buffer_read(dev, subdevice, front-back)