return 0;
}
-static int ndr_write_string(struct ndr *n, void *value, size_t sz)
+static int ndr_write_string(struct ndr *n, char *value)
{
+ size_t sz;
+
+ sz = strlen(value) + 1;
if (n->length <= n->offset + sz)
try_to_realloc_ndr_blob(n, sz);
- strncpy(ndr_get_field(n), value, sz);
- sz++;
+ memcpy(ndr_get_field(n), value, sz);
n->offset += sz;
n->offset = ALIGN(n->offset, 2);
return 0;
if (da->version == 3) {
snprintf(hex_attr, 10, "0x%x", da->attr);
- ndr_write_string(n, hex_attr, strlen(hex_attr));
+ ndr_write_string(n, hex_attr);
} else {
- ndr_write_string(n, "", strlen(""));
+ ndr_write_string(n, "");
}
ndr_write_int16(n, da->version);
ndr_write_int32(n, da->version);