void e_document_ex::parse_error(const char *what, void *where) { e_document::parse_error(what, where); if (where) { char buffer[100]; strncpy_ex(buffer, (char *)where, 100); printf("parse error: %s\n\tnear: %s\n", what, buffer); } else { printf("parse error: %s\n", what); } }
/* this returns a new packet with the specified params */ VCRYPT_PACKET * packet_new(uint8_t dest, const char *callee_username, uint8_t type, size_t payload_size) { VCRYPT_PACKET *packet = calloc(1, PACKET_HEAD_SIZE + payload_size); if (packet == NULL ) { return NULL ; } packet->type = type; packet->dest = dest; packet->queue_id = 0; packet->payload_len = (uint32_t) payload_size; packet->username[0] = 0; if (callee_username) { strncpy_ex(packet->username, callee_username, MAX_USERNAME_L); } return packet; }