BufLength
Description
Current byte count of b. Read-only (the comma-expression form rejects BufLength(b) = n at compile time – use BufResize).
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Buf.h:147:
/// TAGS: Buf, Iter, Construct
///
#define BufIterFromBuf(b_) BufIterFromMemory(BufData(b_), BufLength(b_))
// ---------------------------------------------------------------------------
- In
ProcMaps.h:104:
File *: proc_maps_load_from_file((out), (File *)(src), MisraScope), \
Str *: proc_maps_load_from_bytes((out), (const u8 *)StrBegin((Str *)(src)), StrLen((Str *)(src)), MisraScope), \
Buf *: proc_maps_load_from_bytes((out), BufData((Buf *)(src)), BufLength((Buf *)(src)), MisraScope) \
)
#define ProcMapsLoadFrom_3(out, src, alloc) \- In
ProcMaps.h:116:
ALLOCATOR_OF(alloc) \
), \
Buf *: proc_maps_load_from_bytes((out), BufData((Buf *)(src)), BufLength((Buf *)(src)), ALLOCATOR_OF(alloc)) \
)
#define ProcMapsLoadFrom_4(out, bytes, len, alloc) \- In
Io.c:1109:
bool ok = render_binary_fmt(&tmp, fmtstr, argv, argc);
if (ok) {
if (offset > BufLength(out) || StrLen(&tmp) > BufLength(out) - offset) {
LOG_ERROR(
"BufPatchFmt: write of {} bytes at offset {} exceeds buf length {}",- In
Io.c:1114:
StrLen(&tmp),
offset,
BufLength(out)
);
ok = false;- In
Pe.c:159:
// DOS header gives us e_lfanew, the offset to the NT headers.
static bool pe_decode_dos(PeContext *ctx) {
if (BufLength(&ctx->out->data) < 64) {
LOG_ERROR("PE: file too small for DOS header");
return false;- In
Pe.c:175:
BufIter c = BufIterFromMemory(
BufData(&ctx->out->data) + DOS_E_LFANEW_OFFSET,
BufLength(&ctx->out->data) - DOS_E_LFANEW_OFFSET
);
if (!BufReadU32LE(&c, &e_lfanew))- In
Pe.c:179:
if (!BufReadU32LE(&c, &e_lfanew))
return false;
if (e_lfanew >= BufLength(&ctx->out->data)) {
LOG_ERROR("PE: e_lfanew past EOF");
return false;- In
Pe.c:190:
static bool pe_decode_nt(PeContext *ctx, u64 *out_opt_offset) {
BufIter c =
BufIterFromMemory(BufData(&ctx->out->data) + ctx->nt_offset, BufLength(&ctx->out->data) - ctx->nt_offset);
u32 sig;
if (!BufReadU32LE(&c, &sig) || sig != NT_SIGNATURE) {- In
Pe.c:216:
// NumberOfRvaAndSizes, and the DataDirectory[DEBUG] entry.
static bool pe_decode_optional(PeContext *ctx, u64 opt_offset) {
if (opt_offset > BufLength(&ctx->out->data) || ctx->opt_hdr_size > BufLength(&ctx->out->data) - opt_offset) {
LOG_ERROR("PE: optional header overruns file");
return false;- In
Pe.c:376:
static bool pe_decode_sections(PeContext *ctx, u64 opt_offset) {
u64 sec_offset = opt_offset + ctx->opt_hdr_size;
BufIter c = BufIterFromMemory(BufData(&ctx->out->data) + sec_offset, BufLength(&ctx->out->data) - sec_offset);
for (u32 i = 0; i < ctx->num_sections; ++i) {- In
Pe.c:439:
};
u32 num_entries = ctx->debug_dir_size / DEBUG_ENTRY_SIZE;
if (dir_offset + (u64)num_entries * DEBUG_ENTRY_SIZE > BufLength(&ctx->out->data)) {
LOG_ERROR("PE: debug directory overruns file");
return;- In
Pe.c:446:
for (u32 i = 0; i < num_entries; ++i) {
u64 entry_off = dir_offset + (u64)i * DEBUG_ENTRY_SIZE;
BufIter c = BufIterFromMemory(BufData(&ctx->out->data) + entry_off, BufLength(&ctx->out->data) - entry_off);
u32 charac, ts, type, sz, raddr, rptr;
u16 ver_maj, ver_min;- In
Pe.c:458:
if (type != IMAGE_DEBUG_TYPE_CODEVIEW)
continue;
if (rptr + (u64)sz > BufLength(&ctx->out->data)) {
LOG_ERROR("PE: codeview record points outside file");
continue;- In
Pe.c:605:
if (rva >= vstart && (u64)rva < vend) {
u64 off = (u64)s->raw_offset + ((u64)rva - vstart);
if (off >= BufLength(&self->data))
return false;
*out_offset = off;- In
Pdb.c:95:
static const u8 *block_ptr(const Pdb *self, u32 block_id) {
u64 off = (u64)block_id * self->block_size;
if (off + self->block_size > BufLength(&self->data))
return NULL;
return BufData(&self->data) + off;- In
Pdb.c:143:
static bool parse_superblock(Pdb *self, u32 *out_num_dir_bytes, u32 *out_block_map_addr) {
if (BufLength(&self->data) < SUPERBLOCK_SIZE) {
LOG_ERROR("PDB: file too small for MSF superblock");
return false;- In
Pdb.c:151:
return false;
}
BufIter sb = BufIterFromMemory(BufData(&self->data) + 32, BufLength(&self->data) - 32);
u32 free_blk, num_blocks, unknown;
if (!BufReadFmt(- In
Pdb.c:173:
return false;
}
if ((u64)num_blocks * self->block_size != BufLength(&self->data)) {
// Some PDBs come with trailing padding; the spec says num_blocks
// * block_size should equal file size. We warn but don't fail.
- In
Tzif.c:196:
return false;
}
bool ok = TzifOffsetFromBuf(BufData(&data), BufLength(&data), unix_seconds, out_offset_seconds);
BufDeinit(&data);
return ok;- In
MachO.c:120:
static bool decode_header(MachoContext *ctx) {
Macho *m = ctx->out;
if (BufLength(&m->data) < MH_HEADER_64_SIZE) {
LOG_ERROR("MachO: file too small for header");
return false;- In
MachO.c:292:
static bool walk_load_commands(MachoContext *ctx) {
if ((u64)MH_HEADER_64_SIZE + ctx->sizeofcmds > BufLength(&ctx->out->data)) {
LOG_ERROR("MachO: load commands overrun file");
return false;- In
MachO.c:361:
}
u64 tab_end = (u64)ctx->symoff + (u64)ctx->nsyms * NLIST64_SIZE;
if (tab_end > BufLength(&ctx->out->data)) {
LOG_ERROR("MachO: symtab past EOF");
return false;- In
MachO.c:366:
}
u64 str_end = (u64)ctx->stroff + ctx->strsize;
if (str_end > BufLength(&ctx->out->data)) {
LOG_ERROR("MachO: symbol strtab past EOF");
return false;- In
Elf.c:122:
static bool elf_range_ok(const Elf *self, u64 offset, u64 size) {
if (offset > BufLength(&self->data))
return false;
if (size > BufLength(&self->data))- In
Elf.c:124:
if (offset > BufLength(&self->data))
return false;
if (size > BufLength(&self->data))
return false;
// After the two checks above both `offset` and `size` are
- In
Elf.c:128:
// After the two checks above both `offset` and `size` are
// bounded by `data_size`; subtracting cannot wrap.
if (size > BufLength(&self->data) - offset)
return false;
return true;- In
Elf.c:138:
static bool elf_decode_header(Elf *self) {
if (BufLength(&self->data) < EI_NIDENT + EHDR64_SIZE_AFTER_IDENT) {
LOG_ERROR("Elf: file too small for ELF64 header ({} bytes)", (u64)BufLength(&self->data));
return false;- In
Elf.c:139:
static bool elf_decode_header(Elf *self) {
if (BufLength(&self->data) < EI_NIDENT + EHDR64_SIZE_AFTER_IDENT) {
LOG_ERROR("Elf: file too small for ELF64 header ({} bytes)", (u64)BufLength(&self->data));
return false;
}- In
File.c:836:
FileClose(&r);
ok = ok && (got == (i64)N) && (BufLength(&dst) == (size)N) && (MemCompare(BufData(&dst), BufData(&src), N) == 0);
BufDeinit(&src);- In
Buf.c:16:
DefaultAllocator alloc = DefaultAllocatorInit();
Buf b = BufInit(&alloc);
bool ok = BufLength(&b) == 0;
BufWriteU8(&b, 0x42);
BufWriteU8(&b, 0x43);- In
Buf.c:19:
BufWriteU8(&b, 0x42);
BufWriteU8(&b, 0x43);
ok = ok && BufLength(&b) == 2 && BufData(&b)[0] == 0x42 && BufData(&b)[1] == 0x43;
BufClear(&b);
ok = ok && BufLength(&b) == 0;- In
Buf.c:21:
ok = ok && BufLength(&b) == 2 && BufData(&b)[0] == 0x42 && BufData(&b)[1] == 0x43;
BufClear(&b);
ok = ok && BufLength(&b) == 0;
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);- In
Buf.c:44:
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, // u64 BE
};
bool ok = BufLength(&b) == sizeof(expect) && MemCompare(BufData(&b), expect, sizeof(expect)) == 0;
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);- In
Buf.c:58:
BufWriteULeb128(&b, 16384);
const u8 expect_uleb[] = {0x00, 0x7F, 0x80, 0x01, 0x80, 0x80, 0x01};
if (BufLength(&b) != sizeof(expect_uleb) || MemCompare(BufData(&b), expect_uleb, sizeof(expect_uleb)) != 0) {
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);- In
Buf.c:70:
BufWriteSLeb128(&b, -64);
const u8 expect_sleb[] = {0x00, 0x7F, 0xC0, 0x00, 0x40};
bool ok = BufLength(&b) == sizeof(expect_sleb) && MemCompare(BufData(&b), expect_sleb, sizeof(expect_sleb)) == 0;
BufDeinit(&b);- In
Buf.c:82:
BufWriteZstr(&b, "hi");
const u8 expect[] = {'h', 'i', 0};
bool ok = BufLength(&b) == sizeof(expect) && MemCompare(BufData(&b), expect, sizeof(expect)) == 0;
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);- In
Buf.c:158:
bool ok = BufAppendFmt(&b, "{<2r}{>4r}", (u16)0xCAFE, (u32)0xDEADBEEF);
const u8 expect[] = {0x99, 0xFE, 0xCA, 0xDE, 0xAD, 0xBE, 0xEF};
ok = ok && BufLength(&b) == sizeof(expect) && MemCompare(BufData(&b), expect, sizeof(expect)) == 0;
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);- In
Buf.c:172:
bool ok = BufWriteFmt(&b, "{<2r}", (u16)0x1234);
const u8 expect[] = {0x34, 0x12};
ok = ok && BufLength(&b) == sizeof(expect) && MemCompare(BufData(&b), expect, sizeof(expect)) == 0;
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);- In
Buf.c:200:
0x11
};
ok = ok && BufLength(&b) == sizeof(expect) && MemCompare(BufData(&b), expect, sizeof(expect)) == 0;
// Out-of-range patch must fail and leave the buf unchanged.
- In
Buf.c:204:
// Out-of-range patch must fail and leave the buf unchanged.
Buf snapshot = BufInit(&alloc);
BufPushBytes(&snapshot, BufData(&b), BufLength(&b));
ok = ok && !BufPatchFmt(&b, BufLength(&b), "{<2r}", (u16)0);
ok = ok && BufLength(&b) == BufLength(&snapshot);- In
Buf.c:205:
Buf snapshot = BufInit(&alloc);
BufPushBytes(&snapshot, BufData(&b), BufLength(&b));
ok = ok && !BufPatchFmt(&b, BufLength(&b), "{<2r}", (u16)0);
ok = ok && BufLength(&b) == BufLength(&snapshot);
ok = ok && MemCompare(BufData(&b), BufData(&snapshot), BufLength(&b)) == 0;- In
Buf.c:206:
BufPushBytes(&snapshot, BufData(&b), BufLength(&b));
ok = ok && !BufPatchFmt(&b, BufLength(&b), "{<2r}", (u16)0);
ok = ok && BufLength(&b) == BufLength(&snapshot);
ok = ok && MemCompare(BufData(&b), BufData(&snapshot), BufLength(&b)) == 0;
BufDeinit(&snapshot);- In
Buf.c:207:
ok = ok && !BufPatchFmt(&b, BufLength(&b), "{<2r}", (u16)0);
ok = ok && BufLength(&b) == BufLength(&snapshot);
ok = ok && MemCompare(BufData(&b), BufData(&snapshot), BufLength(&b)) == 0;
BufDeinit(&snapshot);- In
Write.c:788:
// Little-endian u32: 0xDEADBEEF -> EF BE AD DE.
ok = ok && BufWriteFmt(&b, "{<4r}", (u32)0xDEADBEEF);
ok = ok && (BufLength(&b) == 4);
{
const u8 *d = BufData(&b);- In
Write.c:827:
// "TZif" literal magic + a version byte, emitted verbatim.
ok = ok && BufWriteFmt(&b, "TZif{>1r}", (u8)'2');
ok = ok && (BufLength(&b) == 5);
{
const u8 *d = BufData(&b);- In
Write.c:861:
ok = ok && BufWriteFmt(&b, "{{{>1r}", (u8)0x41); // literal '{' then 'A'
ok = ok && (BufLength(&b) == 2) && (BufData(&b)[0] == '{') && (BufData(&b)[1] == 0x41);
BufIter it = BufIterFromBuf(&b);- In
Write.c:883:
// exactly one byte remaining.
ok = ok && BufWriteFmt(&b, "{>1r}Z", (u8)'Q');
ok = ok && (BufLength(&b) == 2);
{
BufIter it = BufIterFromBuf(&b);- In
Write.c:1857:
ok = ok && BufWriteFmt(&b, "{<1r}", (u8)0x05);
ok = ok && (BufLength(&b) == 1);
BufIter it = BufIterFromBuf(&b);- In
Write.c:1883:
ok = ok && BufWriteFmt(&b, "{<4r}", (u32)0xDEADBEEF);
ok = ok && (BufLength(&b) == 4);
BufIter it = BufIterFromBuf(&b);- In
Write.c:1907:
ok = ok && BufWriteFmt(&b, "{>8r}", (u64)0x0102030405060708ULL);
ok = ok && (BufLength(&b) == 8);
BufIter it = BufIterFromBuf(&b);- In
Write.c:1931:
ok = ok && BufWriteFmt(&b, "{<8r}", (i64)-1234567890123LL);
ok = ok && (BufLength(&b) == 8);
BufIter it = BufIterFromBuf(&b);- In
Write.c:3505:
// u32 LE 0x11223344 -> bytes 44 33 22 11 at [4,8).
ok = ok && BufPatchFmt(&b, 4, "{<4r}", (u32)0x11223344);
ok = ok && (BufLength(&b) == 8);
{
const u8 *d = BufData(&b);- In
Write.c:3531:
// Empty format renders zero bytes; offset 8 == BufLength.
ok = ok && BufPatchFmt(&b, 8, "");
ok = ok && (BufLength(&b) == 8);
{
const u8 *d = BufData(&b);- In
Write.c:3560:
bool rc = BufPatchFmt(&b, 4, "{<2r}{<4r}", (u16)0xBEEF, (u32)0xDEADC0DE);
ok = ok && (rc == false);
ok = ok && (BufLength(&b) == 8);
{
const u8 *d = BufData(&b);- In
Write.c:3582:
bool ok = BufAppendFmt(&b, "{<1r}", (u8)0x7E);
const u8 expect[] = {0x7E};
ok = ok && BufLength(&b) == sizeof(expect) && MemCompare(BufData(&b), expect, sizeof(expect)) == 0;
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);- In
Write.c:3598:
bool ok = BufAppendFmt(&b, "{<8r}", (i64)0x0102030405060708ll);
const u8 expect[] = {0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01};
ok = ok && BufLength(&b) == sizeof(expect) && MemCompare(BufData(&b), expect, sizeof(expect)) == 0;
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);- In
Write.c:3616:
bool ok = BufAppendFmt(&b, "{<8r}", in.f);
const u8 expect[] = {0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01};
ok = ok && BufLength(&b) == sizeof(expect) && MemCompare(BufData(&b), expect, sizeof(expect)) == 0;
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);- In
Write.c:3698:
Buf b = BufInit(&alloc);
bool ok = BufWriteFmt(&b, "{<1r}", (u8)0xAB);
ok = ok && (BufLength(&b) == 1) && (BufData(&b)[0] == 0xAB);
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);- In
Write.c:3805:
const u8 *d = BufData(&b);
bool ok = r && (BufLength(&b) == 4) && d[0] == 0xAA && d[1] == 0xBB && d[2] == 0xCC && d[3] == 0xDD;
BufDeinit(&b);- In
Write.c:3899:
bool ok = BufWriteFmt(&b, "{>2r}", (u16)0x1234);
const u8 *d = BufData(&b);
ok = ok && (BufLength(&b) == 2) && d[0] == 0x12 && d[1] == 0x34;
BufDeinit(&b);- In
Write.c:3913:
const u8 *d = BufData(&b);
// Host is little-endian: low byte first.
ok = ok && (BufLength(&b) == 2) && d[0] == 0x34 && d[1] == 0x12;
BufDeinit(&b);- In
Write.c:3926:
bool ok = BufWriteFmt(&b, "{^4r}", (u32)0x11223344);
const u8 *d = BufData(&b);
ok = ok && (BufLength(&b) == 4) && d[0] == 0x44 && d[1] == 0x33 && d[2] == 0x22 && d[3] == 0x11;
BufDeinit(&b);- In
Write.c:3939:
bool ok = BufWriteFmt(&b, "{^8r}", (u64)0x0102030405060708ULL);
const u8 *d = BufData(&b);
ok = ok && (BufLength(&b) == 8) && d[0] == 0x08 && d[1] == 0x07 && d[2] == 0x06 && d[3] == 0x05 && d[4] == 0x04 &&
d[5] == 0x03 && d[6] == 0x02 && d[7] == 0x01;- In
Write.c:4627:
ok = ok && BufWriteFmt(&b, "{^2r}", (u16)0x1234);
ok = ok && (BufLength(&b) == 2);
BufIter it = BufIterFromBuf(&b);- In
Write.c:5051:
Buf b = BufInit(&alloc);
bool ok = BufWriteFmt(&b, "{<2r}{>4r}", (u16)0x1234, (u32)0xAABBCCDD);
ok = ok && (BufLength(&b) == 6);
BufIter it = BufIterFromBuf(&b);
u16 a = 0;- In
Read.c:1312:
ok = ok && BufWriteFmt(&b, "{^4r}", (u32)0xAABBCCDDu);
ok = ok && (BufLength(&b) == 4);
BufIter it = BufIterFromBuf(&b);- In
Read.c:1354:
ok = ok && BufWriteFmt(&b, "{<8r}", expected);
ok = ok && (BufLength(&b) == 8);
BufIter it = BufIterFromBuf(&b);- In
Read.c:1381:
ok = ok && BufWriteFmt(&b, "{<8r}", expected);
ok = ok && (BufLength(&b) == 8);
BufIter it = BufIterFromBuf(&b);- In
Read.c:1411:
ok = ok && BufWriteFmt(&b, "{^8r}", expected);
ok = ok && (BufLength(&b) == 8);
BufIter it = BufIterFromBuf(&b);- In
Pe.c:1621:
bool opened = PeOpenFromMemoryCopy(&pe, blob, sizeof(blob), ALLOCATOR_OF(&alloc));
// Real code: rejected AND `out` zeroed by PeDeinit on the fail path.
bool ok = !opened && BufData(&pe.data) == NULL && BufLength(&pe.data) == 0 && VecLen(&pe.sections) == 0;
if (opened)
PeDeinit(&pe);- In
Dns.c:27:
0x00, 0x00, 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e',
0x03, 'c', 'o', 'm', 0x00, 0x00, 0x01, 0x00, 0x01};
bool match = ok && BufLength(&buf) == sizeof(expected);
for (u64 i = 0; match && i < sizeof(expected); ++i) {
if (BufData(&buf)[i] != expected[i]) {- In
Dns.c:48:
bool ok = DnsBuildQuery(&no_dot, 1, "a.b.c", DNS_TYPE_AAAA) && DnsBuildQuery(&w_dot, 1, "a.b.c.", DNS_TYPE_AAAA);
bool match = ok && BufLength(&no_dot) == BufLength(&w_dot);
for (u64 i = 0; match && i < BufLength(&no_dot); ++i) {
if (BufData(&no_dot)[i] != BufData(&w_dot)[i]) {- In
Dns.c:49:
bool match = ok && BufLength(&no_dot) == BufLength(&w_dot);
for (u64 i = 0; match && i < BufLength(&no_dot); ++i) {
if (BufData(&no_dot)[i] != BufData(&w_dot)[i]) {
match = false;- In
Dns.c:321:
0x00, 0x03, 'w', 'w', 'w', 0x07, 'e', 'x', 'a', 'm', 'p',
'l', 'e', 0x03, 'c', 'o', 'm', 0x00, 0x00, 0x01, 0x00, 0x01};
bool match = ok && BufLength(&buf) == sizeof(expected);
for (u64 i = 0; match && i < sizeof(expected); ++i) {
if (BufData(&buf)[i] != expected[i]) {- In
Dns.c:343:
// header(12) + qname(just 0x00) + qtype(2) + qclass(2) = 17 bytes.
bool match = ok && BufLength(&buf) == 17 && BufData(&buf)[12] == 0x00 && BufData(&buf)[13] == 0x00 &&
BufData(&buf)[14] == 0x01 && BufData(&buf)[15] == 0x00 && BufData(&buf)[16] == 0x01;- In
Dns.c:368:
// header(12) + [63]+63 label bytes + 0 term + 4 = 12+64+1+4 = 81; first
// qname byte (offset 12) must be the length 63.
bool match = ok && BufLength(&buf) == 81 && BufData(&buf)[12] == 63;
VecDeinit(&buf);- In
Dns.c:386:
bool ok = DnsBuildQuery(&no_dot, 7, "a.b", DNS_TYPE_A) && DnsBuildQuery(&w_dot, 7, "a.b.", DNS_TYPE_A);
bool match = ok && BufLength(&no_dot) == BufLength(&w_dot) && BufLength(&no_dot) > 0;
for (u64 i = 0; match && i < BufLength(&no_dot); ++i) {
if (BufData(&no_dot)[i] != BufData(&w_dot)[i]) {- In
Dns.c:387:
bool match = ok && BufLength(&no_dot) == BufLength(&w_dot) && BufLength(&no_dot) > 0;
for (u64 i = 0; match && i < BufLength(&no_dot); ++i) {
if (BufData(&no_dot)[i] != BufData(&w_dot)[i]) {
match = false;- In
Dns.c:430:
// header(12) + wire 220 + 1 terminator + 4 = 237.
bool match = ok && BufLength(&buf) == 237;
VecDeinit(&buf);- In
Dns.c:453:
// header(12) + wire 254 + 1 terminator + 4 = 271.
bool match = ok && BufLength(&buf) == 271;
VecDeinit(&buf);- In
Dns.c:478:
0x00, 0x00, 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e',
0x03, 'c', 'o', 'm', 0x00, 0x00, 0x01, 0x00, 0x01};
bool match = ok && BufLength(&buf) == sizeof(expected);
for (u64 i = 0; match && i < sizeof(expected); ++i) {
if (BufData(&buf)[i] != expected[i]) {- In
Dns.c:1087:
ZstrCompare(StrBegin(&r->name), "a") == 0;
// rdata raw stash must equal the 4 IP bytes.
match = match && BufLength(&r->rdata) == 4 && BufData(&r->rdata)[0] == 8 && BufData(&r->rdata)[1] == 8 &&
BufData(&r->rdata)[2] == 4 && BufData(&r->rdata)[3] == 4;
}- In
Dns.c:1231:
}
// rdata stash must hold all 16 bytes.
match = match && BufLength(&r->rdata) == 16;
for (u64 i = 0; match && i < 16; ++i) {
if (BufData(&r->rdata)[i] != ip6[i]) {- In
Tzif.c:56:
static bool resolve(Buf *b, i64 t, i32 *off) {
return TzifOffsetFromBuf(BufData(b), BufLength(b), t, off);
}- In
Tzif.c:118:
BufAppendFmt(&b, "{>4r}{>1r}{>1r}", (i32)-18000, (u8)0, (u8)0); // ttinfo[1] STD
i32 off = 0;
bool ok = TzifOffsetFromBuf(BufData(&b), BufLength(&b), 0, &off);
BufDeinit(&b);
DefaultAllocatorDeinit(&a);- In
Tzif.c:132:
BufAppendFmt(&b, "{>4r}{>1r}{>1r}", (i32)-14400, (u8)1, (u8)0); // sole ttinfo: DST, no STD
i32 off = 7;
bool ok = TzifOffsetFromBuf(BufData(&b), BufLength(&b), 0, &off);
BufDeinit(&b);
DefaultAllocatorDeinit(&a);- In
Tzif.c:150:
BufAppendFmt(&b, "{>4r}{>1r}{>1r}", (i32)-14400, (u8)1, (u8)0); // v2 sole ttinfo: DST, no STD
i32 off = 7;
bool ok = TzifOffsetFromBuf(BufData(&b), BufLength(&b), 0, &off);
BufDeinit(&b);
DefaultAllocatorDeinit(&a);
Last updated on