if (Siz == 0)
{
+ free(NewBuf);
return NULL;
}
*/
void StrBufAppendBuf(StrBuf *Buf, const StrBuf *AppendBuf, unsigned long Offset)
{
- if ((AppendBuf == NULL) || (Buf == NULL) || (AppendBuf->buf == NULL))
+ if ((AppendBuf == NULL) || (AppendBuf->buf == NULL) ||
+ (Buf == NULL) || (Buf->buf == NULL))
return;
if (Buf->BufSize - Offset < AppendBuf->BufUsed + Buf->BufUsed + 1)
*/
void StrBufCutRight(StrBuf *Buf, int nChars)
{
- if ((Buf == NULL) || (Buf->BufUsed == 0)) return;
+ if ((Buf == NULL) || (Buf->BufUsed == 0) || (Buf->buf == NULL))
+ return;
+
if (nChars >= Buf->BufUsed) {
FlushStrBuf(Buf);
return;
int a, b, len;
char hex[3];
- if (target != NULL)
- FlushStrBuf(target);
-
- if (source == NULL ||target == NULL)
+ if ((source == NULL) || (target == NULL) || (target->buf == NULL))
{
return;
}
+ if (target != NULL)
+ FlushStrBuf(target);
+
len = source->BufUsed;
for (a = 0; a < len; ++a) {
if (target->BufUsed >= target->BufSize)
if (target != NULL)
FlushStrBuf(target);
- if (source == NULL ||target == NULL)
+ if ((source == NULL) || (target == NULL) || (target->buf == NULL))
{
return;
}
const char *aptr, *ptr, *eptr;
char *optr, *xptr;
- if ((FB == NULL) || (LineBuf == NULL))
+ if ((FB == NULL) || (LineBuf == NULL) || (LineBuf->buf == NULL))
return eReadFail;
{
int len, rlen, slen;
- if (buf == NULL) {
+ if ((buf == NULL) || (buf->buf == NULL)) {
*Error = strerror(EINVAL);
return -1;
}
struct timeval tv;
fd_set rfds;
- if ((Buf == NULL) || (*fd == -1))
+ if ((Buf == NULL) || (Buf->buf == NULL) || (*fd == -1))
{
*Error = ErrRBLF_BLOBPreConditionFailed;
return -1;
if ((Buf == NULL) ||
(*Ptr == StrBufNOTNULL) ||
- (LineBuf == NULL))
+ (LineBuf == NULL)||
+ (LineBuf->buf == NULL))
{
*Ptr = StrBufNOTNULL;
return 0;