Index: uspace/lib/compress/inflate.c
===================================================================
--- uspace/lib/compress/inflate.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
+++ uspace/lib/compress/inflate.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -103,12 +103,12 @@
 	size_t destlen;   /**< Output buffer size */
 	size_t destcnt;   /**< Position in the output buffer */
-	
+
 	uint8_t *src;     /**< Input buffer */
 	size_t srclen;    /**< Input buffer size */
 	size_t srccnt;    /**< Position in the input buffer */
-	
+
 	uint16_t bitbuf;  /**< Bit buffer */
 	size_t bitlen;    /**< Number of bits in the bit buffer */
-	
+
 	bool overrun;     /**< Overrun condition */
 } inflate_state_t;
@@ -240,5 +240,5 @@
 	/* Bit accumulator for at least 20 bits */
 	uint32_t val = state->bitbuf;
-	
+
 	while (state->bitlen < cnt) {
 		if (state->srccnt == state->srclen) {
@@ -246,5 +246,5 @@
 			return 0;
 		}
-		
+
 		/* Load 8 more bits */
 		val |= ((uint32_t) state->src[state->srccnt]) << state->bitlen;
@@ -252,9 +252,9 @@
 		state->bitlen += 8;
 	}
-	
+
 	/* Update bits in the buffer */
 	state->bitbuf = (uint16_t) (val >> cnt);
 	state->bitlen -= cnt;
-	
+
 	return ((uint16_t) (val & ((1 << cnt) - 1)));
 }
@@ -275,32 +275,32 @@
 	state->bitbuf = 0;
 	state->bitlen = 0;
-	
+
 	if (state->srccnt + 4 > state->srclen)
 		return ELIMIT;
-	
+
 	uint16_t len =
 	    state->src[state->srccnt] | (state->src[state->srccnt + 1] << 8);
 	uint16_t len_compl =
 	    state->src[state->srccnt + 2] | (state->src[state->srccnt + 3] << 8);
-	
+
 	/* Check block length and its complement */
 	if (((int16_t) len) != ~((int16_t) len_compl))
 		return EINVAL;
-	
+
 	state->srccnt += 4;
-	
+
 	/* Check input buffer size */
 	if (state->srccnt + len > state->srclen)
 		return ELIMIT;
-	
+
 	/* Check output buffer size */
 	if (state->destcnt + len > state->destlen)
 		return ENOMEM;
-	
+
 	/* Copy data */
 	memcpy(state->dest + state->destcnt, state->src + state->srccnt, len);
 	state->srccnt += len;
 	state->destcnt += len;
-	
+
 	return EOK;
 }
@@ -323,5 +323,5 @@
 	size_t index = 0;  /* Index of the first code of the given length
 	                      in the symbol table */
-	
+
 	size_t len;  /* Current number of bits in the code */
 	for (len = 1; len <= MAX_HUFFMAN_BIT; len++) {
@@ -329,5 +329,5 @@
 		code |= get_bits(state, 1);
 		CHECK_OVERRUN(*state);
-		
+
 		uint16_t count = huffman->count[len];
 		if (code < first + count) {
@@ -336,5 +336,5 @@
 			return EOK;
 		}
-		
+
 		/* Update for next length */
 		index += count;
@@ -343,5 +343,5 @@
 		code <<= 1;
 	}
-	
+
 	return EINVAL;
 }
@@ -364,15 +364,15 @@
 	for (len = 0; len <= MAX_HUFFMAN_BIT; len++)
 		huffman->count[len] = 0;
-	
+
 	/* We assume that the lengths are within bounds */
 	size_t symbol;
 	for (symbol = 0; symbol < n; symbol++)
 		huffman->count[length[symbol]]++;
-	
+
 	if (huffman->count[0] == n) {
 		/* The code is complete, but decoding will fail */
 		return 0;
 	}
-	
+
 	/* Check for an over-subscribed or incomplete set of lengths */
 	int16_t left = 1;
@@ -385,12 +385,12 @@
 		}
 	}
-	
+
 	/* Generate offsets into symbol table */
 	uint16_t offs[MAX_HUFFMAN_BIT + 1];
-	
+
 	offs[1] = 0;
 	for (len = 1; len < MAX_HUFFMAN_BIT; len++)
 		offs[len + 1] = offs[len] + huffman->count[len];
-	
+
 	for (symbol = 0; symbol < n; symbol++) {
 		if (length[symbol] != 0) {
@@ -399,5 +399,5 @@
 		}
 	}
-	
+
 	return left;
 }
@@ -422,5 +422,5 @@
 {
 	uint16_t symbol;
-	
+
 	do {
 		errno_t err = huffman_decode(state, len_code, &symbol);
@@ -429,10 +429,10 @@
 			return err;
 		}
-		
+
 		if (symbol < 256) {
 			/* Write out literal */
 			if (state->destcnt == state->destlen)
 				return ENOMEM;
-			
+
 			state->dest[state->destcnt] = (uint8_t) symbol;
 			state->destcnt++;
@@ -442,20 +442,20 @@
 			if (symbol >= 29)
 				return EINVAL;
-			
+
 			size_t len = lens[symbol] + get_bits(state, lens_ext[symbol]);
 			CHECK_OVERRUN(*state);
-			
+
 			/* Get distance */
 			err = huffman_decode(state, dist_code, &symbol);
 			if (err != EOK)
 				return err;
-			
+
 			size_t dist = dists[symbol] + get_bits(state, dists_ext[symbol]);
 			if (dist > state->destcnt)
 				return ENOENT;
-			
+
 			if (state->destcnt + len > state->destlen)
 				return ENOMEM;
-			
+
 			while (len > 0) {
 				/* Copy len bytes from distance bytes back */
@@ -467,5 +467,5 @@
 		}
 	} while (symbol != 256);
-	
+
 	return EOK;
 }
@@ -510,25 +510,25 @@
 	huffman_t dyn_len_code;
 	huffman_t dyn_dist_code;
-	
+
 	dyn_len_code.count = dyn_len_count;
 	dyn_len_code.symbol = dyn_len_symbol;
-	
+
 	dyn_dist_code.count = dyn_dist_count;
 	dyn_dist_code.symbol = dyn_dist_symbol;
-	
+
 	/* Get number of bits in each table */
 	uint16_t nlen = get_bits(state, 5) + 257;
 	CHECK_OVERRUN(*state);
-	
+
 	uint16_t ndist = get_bits(state, 5) + 1;
 	CHECK_OVERRUN(*state);
-	
+
 	uint16_t ncode = get_bits(state, 4) + 4;
 	CHECK_OVERRUN(*state);
-	
+
 	if ((nlen > MAX_LITLEN) || (ndist > MAX_DIST)
 	    || (ncode > MAX_ORDER))
 		return EINVAL;
-	
+
 	/* Read code length code lengths */
 	uint16_t index;
@@ -537,14 +537,14 @@
 		CHECK_OVERRUN(*state);
 	}
-	
+
 	/* Set missing lengths to zero */
 	for (index = ncode; index < MAX_ORDER; index++)
 		length[order[index]] = 0;
-	
+
 	/* Build Huffman code */
 	int16_t rc = huffman_construct(&dyn_len_code, length, MAX_ORDER);
 	if (rc != 0)
 		return EINVAL;
-	
+
 	/* Read length/literal and distance code length tables */
 	index = 0;
@@ -554,5 +554,5 @@
 		if (err != EOK)
 			return EOK;
-		
+
 		if (symbol < 16) {
 			length[index] = symbol;
@@ -560,9 +560,9 @@
 		} else {
 			uint16_t len = 0;
-			
+
 			if (symbol == 16) {
 				if (index == 0)
 					return EINVAL;
-				
+
 				len = length[index - 1];
 				symbol = get_bits(state, 2) + 3;
@@ -575,8 +575,8 @@
 				CHECK_OVERRUN(*state);
 			}
-			
+
 			if (index + symbol > nlen + ndist)
 				return EINVAL;
-			
+
 			while (symbol > 0) {
 				length[index] = len;
@@ -586,19 +586,19 @@
 		}
 	}
-	
+
 	/* Check for end-of-block code */
 	if (length[256] == 0)
 		return EINVAL;
-	
+
 	/* Build Huffman tables for literal/length codes */
 	rc = huffman_construct(&dyn_len_code, length, nlen);
 	if ((rc < 0) || ((rc > 0) && (dyn_len_code.count[0] + 1 != nlen)))
 		return EINVAL;
-	
+
 	/* Build Huffman tables for distance codes */
 	rc = huffman_construct(&dyn_dist_code, length + nlen, ndist);
 	if ((rc < 0) || ((rc > 0) && (dyn_dist_code.count[0] + 1 != ndist)))
 		return EINVAL;
-	
+
 	return inflate_codes(state, &dyn_len_code, &dyn_dist_code);
 }
@@ -622,30 +622,30 @@
 	/* Initialize the state */
 	inflate_state_t state;
-	
+
 	state.dest = (uint8_t *) dest;
 	state.destlen = destlen;
 	state.destcnt = 0;
-	
+
 	state.src = (uint8_t *) src;
 	state.srclen = srclen;
 	state.srccnt = 0;
-	
+
 	state.bitbuf = 0;
 	state.bitlen = 0;
-	
+
 	state.overrun = false;
-	
+
 	uint16_t last;
 	errno_t ret = EOK;
-	
+
 	do {
 		/* Last block is indicated by a non-zero bit */
 		last = get_bits(&state, 1);
 		CHECK_OVERRUN(state);
-		
+
 		/* Block type */
 		uint16_t type = get_bits(&state, 2);
 		CHECK_OVERRUN(state);
-		
+
 		switch (type) {
 		case 0:
@@ -662,5 +662,5 @@
 		}
 	} while ((!last) && (ret == 0));
-	
+
 	return ret;
 }
