Commit f9ae5b8a authored by Insop Song's avatar Insop Song

fix issue #21 build fail also updated example code in document

parent 1a160f7f
......@@ -67,7 +67,7 @@ int main(int argc, char** argv)
}
c = zlog_get_category("my_cat");
if (!my_cat) {
if (!c) {
printf("get cat fail\n");
zlog_fini();
return -2;
......
......@@ -143,7 +143,6 @@ static zlog_file_t *zlog_file_check_new(zlog_rotater_t * a_rotater, const char *
{
int nwrite;
int nread;
int nscan;
zlog_file_t *a_file;
/* base_path will not be in list */
......@@ -169,7 +168,7 @@ static zlog_file_t *zlog_file_check_new(zlog_rotater_t * a_rotater, const char *
}
nread = 0;
nscan = sscanf(a_file->path + a_rotater->num_start_len, "%d%n", &(a_file->index), &(nread));
sscanf(a_file->path + a_rotater->num_start_len, "%d%n", &(a_file->index), &(nread));
/* if nothing is scaned, nread will be a random number */
if (a_rotater->num_width != 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment