diff options
Diffstat (limited to 'src/references.c')
-rw-r--r-- | src/references.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/references.c b/src/references.c index 04b9025..5ba4b24 100644 --- a/src/references.c +++ b/src/references.c @@ -16,12 +16,12 @@ refhash(const unsigned char *link_ref) static void reference_free(reference *ref) { - if(ref != NULL) { - free(ref->label); - free(ref->url); - free(ref->title); - free(ref); - } + if(ref != NULL) { + free(ref->label); + free(ref->url); + free(ref->title); + free(ref); + } } // normalize reference: collapse internal whitespace to single space, @@ -33,8 +33,8 @@ static unsigned char *normalize_reference(chunk *ref) strbuf normalized = GH_BUF_INIT; unsigned char *result; - if(ref == NULL) - return NULL; + if(ref == NULL) + return NULL; if (ref->len == 0) return NULL; @@ -50,7 +50,7 @@ static unsigned char *normalize_reference(chunk *ref) free(result); return NULL; } - + return result; } @@ -81,15 +81,15 @@ extern void reference_create(reference_map *map, chunk *label, chunk *url, chunk return; ref = calloc(1, sizeof(*ref)); - if(ref != NULL) { - ref->label = reflabel; - ref->hash = refhash(ref->label); - ref->url = clean_url(url); - ref->title = clean_title(title); - ref->next = NULL; - - add_reference(map, ref); - } + if(ref != NULL) { + ref->label = reflabel; + ref->hash = refhash(ref->label); + ref->url = clean_url(url); + ref->title = clean_title(title); + ref->next = NULL; + + add_reference(map, ref); + } } // Returns reference if refmap contains a reference with matching @@ -125,8 +125,8 @@ void reference_map_free(reference_map *map) { unsigned int i; - if(map == NULL) - return; + if(map == NULL) + return; for (i = 0; i < REFMAP_SIZE; ++i) { reference *ref = map->table[i]; @@ -144,5 +144,5 @@ void reference_map_free(reference_map *map) reference_map *reference_map_new(void) { - return calloc(1, sizeof(reference_map)); + return calloc(1, sizeof(reference_map)); } |