From: Sergey Poznyakoff Date: Mon, 10 Feb 2014 17:51:55 +0000 (+0200) Subject: Bugfix X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Ftar;a=commitdiff_plain;h=e9e94531f0fb4a24a0e8faa3246eb1ff6695e436 Bugfix * src/suffix.c (find_compression_suffix): Fix eventual coredump. --- diff --git a/src/suffix.c b/src/suffix.c index cf4d954..ac34cba 100644 --- a/src/suffix.c +++ b/src/suffix.c @@ -51,7 +51,7 @@ static struct compression_suffix compression_suffixes[] = { }; static struct compression_suffix const * -find_compression_suffix (const char *name, size_t *base_len) +find_compression_suffix (const char *name, size_t *ret_len) { char *suf = strrchr (name, '.'); @@ -67,8 +67,8 @@ find_compression_suffix (const char *name, size_t *base_len) { if (p->length == len && memcmp (p->suffix, suf, len) == 0) { - if (*base_len) - *base_len = strlen (name) - len - 1; + if (ret_len) + *ret_len = strlen (name) - len - 1; return p; } }