return -1;
}
- pch = ChrPtr(WCC->ReadBuf);
- YetRead = WCC->ReadPos - pch;
- if (YetRead > 0)
- {
- long StillThere;
-
- StillThere = StrLength(WCC->ReadBuf) -
- YetRead;
-
- StrBufPlain(Ret,
- WCC->ReadPos,
- StillThere);
- total_len -= StillThere;
- }
- FlushStrBuf(WCC->ReadBuf);
- WCC->ReadPos = NULL;
-
+ if (WCC->ReadPos != NULL) {
+ pch = ChrPtr(WCC->ReadBuf);
+
+ YetRead = WCC->ReadPos - pch;
+ if (YetRead > 0)
+ {
+ long StillThere;
+
+ StillThere = StrLength(WCC->ReadBuf) -
+ YetRead;
+
+ StrBufPlain(Ret,
+ WCC->ReadPos,
+ StillThere);
+ total_len -= StillThere;
+ }
+ FlushStrBuf(WCC->ReadBuf);
+ WCC->ReadPos = NULL;
+ }
if (total_len > 0)
{
rc = StrBufReadBLOB(Ret,