static int btime_print(const iodef_criterion_value_t *cv, libiodef_io_t *fd) { int ret; libiodef_string_t *out; ret = libiodef_string_new(&out); if ( ret < 0 ) return ret; ret = btime_to_string(cv, out); if ( ret < 0 ) { libiodef_string_destroy(out); return ret; } ret = libiodef_io_write(fd, libiodef_string_get_string(out), libiodef_string_get_len(out)); libiodef_string_destroy(out); return ret; }
static int btime_print(const idmef_criterion_value_t *cv, prelude_io_t *fd) { int ret; prelude_string_t *out; ret = prelude_string_new(&out); if ( ret < 0 ) return ret; ret = btime_to_string(cv, out); if ( ret < 0 ) { prelude_string_destroy(out); return ret; } ret = prelude_io_write(fd, prelude_string_get_string(out), prelude_string_get_len(out)); prelude_string_destroy(out); return ret; }