Lines Matching refs:buf

882     if (buf) free(buf);
883 buf = NULL;
890 buf = (XMLSTR)realloc(buf, l * sizeof(XMLCHAR));
892 return toXMLUnSafe(buf, source);
2041 unsigned char *buf = (unsigned char*)malloc(l + 4);
2042 l = fread(buf, 1, l, f);
2044 buf[l] = 0;
2045 buf[l+1] = 0;
2046 buf[l+2] = 0;
2047 buf[l+3] = 0;
2050 if (!myIsTextWideChar(buf, l)) {
2052 if ((buf[0] == 0xef) && (buf[1] == 0xbb) && (buf[2] == 0xbf)) {
2056 XMLSTR b2 = myMultiByteToWideChar((const char*)(buf + headerSz), ce);
2057 free(buf);
2058 buf = (unsigned char*)b2;
2061 if ((buf[0] == 0xef) && (buf[1] == 0xff)) headerSz = 2;
2062 if ((buf[0] == 0xff) && (buf[1] == 0xfe)) headerSz = 2;
2067 if (myIsTextWideChar(buf, l)) {
2068 if ((buf[0] == 0xef) && (buf[1] == 0xff)) headerSz = 2;
2069 if ((buf[0] == 0xff) && (buf[1] == 0xfe)) headerSz = 2;
2070 char *b2 = myWideCharToMultiByte((const wchar_t*)(buf + headerSz));
2071 free(buf);
2072 buf = (unsigned char*)b2;
2075 if ((buf[0] == 0xef) && (buf[1] == 0xbb) && (buf[2] == 0xbf)) {
2082 if (!buf) {
2086 XMLNode x = parseString((XMLSTR)(buf + headerSz), tag, pResults);
2087 free(buf);
3105 XMLNode::XMLCharEncoding XMLNode::guessCharEncoding(void *buf, int l,
3111 if (guessWideCharChars && (myIsTextWideChar(buf, l))) {
3114 unsigned char *b = (unsigned char*)buf;
3153 memcpy(bb, buf, l); // copy buf into bb to be able to do "bb[l]=0"
3214 if (buf) free(buf);
3215 buf = NULL;
3229 XMLSTR curr = (XMLSTR)buf;
3261 return (XMLSTR)buf;
3294 unsigned char XMLParserBase64Tool::decode(XMLCSTR data, unsigned char *buf,
3333 buf[p++] = (unsigned char)((c << 2) | ((d >> 4) & 0x3));
3349 buf[p++] = (unsigned char)(((d << 4) & 0xf0) | ((c >> 2) & 0xf));
3365 buf[p++] = (unsigned char)(((c << 6) & 0xc0) | d);
3371 if ((!buf) && (newsize)) {
3372 buf = malloc(newsize);
3377 buf = realloc(buf, newsize);
3388 if (!decode(data, (unsigned char*)buf, len, xe)) {
3391 return (unsigned char*)buf;