fecdec_filter: Avoid potentially expensive pointer subtraction.
[paraslash.git] / afh_common.c
index aa7f3d9..8c0eed2 100644 (file)
@@ -256,9 +256,10 @@ uint32_t afh_get_largest_chunk_size(struct afh_info *afhi)
  */
 void afh_get_header(struct afh_info *afhi, void *map, const char **buf, size_t *len)
 {
  */
 void afh_get_header(struct afh_info *afhi, void *map, const char **buf, size_t *len)
 {
-       if (!map || !afhi || ! afhi->header_len) {
+       if (!map || !afhi || !afhi->header_len) {
                *buf = NULL;
                *len = 0;
                *buf = NULL;
                *len = 0;
+               return;
        }
        *len = afhi->header_len;
        *buf = map + afhi->header_offset;
        }
        *len = afhi->header_len;
        *buf = map + afhi->header_offset;