=== modified file 'src/libCom/error/errlog.c' --- src/libCom/error/errlog.c 2011-01-07 16:24:31 +0000 +++ src/libCom/error/errlog.c 2011-03-01 18:02:19 +0000 @@ -534,8 +534,10 @@ char *plimit = pbuffer + pvtData.buffersize; pnextFree = plast->message + adjustToWorstCaseAlignment(plast->length); - if (pfirst <= plast && - pnextFree + pvtData.msgNeeded > plimit) { + if (pfirst > plast) { + plimit = (char *)pfirst; + } + else if (pnextFree + pvtData.msgNeeded > plimit) { pnextFree = pbuffer; /* Hit end, wrap to start */ plimit = (char *)pfirst; } === modified file 'src/libCom/test/epicsErrlogTest.c' --- src/libCom/test/epicsErrlogTest.c 2010-09-30 19:36:30 +0000 +++ src/libCom/test/epicsErrlogTest.c 2011-03-01 20:53:34 +0000 @@ -282,7 +282,7 @@ errlogFlush(); testDiag("Logged %u messages", pvt.count); - testOk1(pvt.count == N+2); + testOk1(pvt.count == N+1); /* Clean up */ errlogRemoveListener(&logClient);