Skip to content

Commit

Permalink
Merge pull request #4 from fabiocolacio/master
Browse files Browse the repository at this point in the history
Copy the base_folder parameter with strdup
  • Loading branch information
Mandarancio authored May 6, 2018
2 parents 14a78de + ab26d9b commit 7e252a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/document.c
Original file line number Diff line number Diff line change
Expand Up @@ -3295,7 +3295,7 @@ hoedown_document_new(
const hoedown_renderer *renderer,
hoedown_extensions extensions,
ext_definition * user_ext,
char * base_folder,
const char * base_folder,
size_t max_nesting)
{
hoedown_document *doc = NULL;
Expand All @@ -3306,7 +3306,7 @@ hoedown_document_new(
memcpy(&doc->md, renderer, sizeof(hoedown_renderer));

doc->extensions = user_ext;
doc->base_folder = base_folder;
doc->base_folder = (base_folder != NULL) ? strdup (base_folder) : NULL;

doc->counter = (h_counter){0, 0, 0};

Expand Down
2 changes: 1 addition & 1 deletion src/document.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ hoedown_document *hoedown_document_new(
const hoedown_renderer *renderer,
hoedown_extensions extensions,
ext_definition * exeternal_extensions,
char * base_folder,
const char * base_folder,
size_t max_nesting
) __attribute__ ((malloc));

Expand Down

0 comments on commit 7e252a7

Please sign in to comment.