Browse Source

+ added wrapper around yajl_get_error()

master
Alex 'AdUser' Z 13 years ago
parent
commit
1e5ad7497a
  1. 13
      src/json2torrent.c

13
src/json2torrent.c

@ -54,6 +54,19 @@ yajl_callbacks callbacks = {
write_end /* end array */ write_end /* end array */
}; };
void
check_yajl_error(struct yajl_handle_t *handle, unsigned char *buf, size_t read)
{
unsigned char *yajl_error = NULL;
if ((yajl_error = yajl_get_error(handle, 1, buf, read)) != NULL)
{
fwrite(buf, read, 1, stderr);
fputc('\n', stderr);
yajl_free_error(handle, yajl_error);
}
}
int int
main(int argc, char **argv) main(int argc, char **argv)
{ {

Loading…
Cancel
Save