Index: kernel/generic/src/lib/str.c
===================================================================
--- kernel/generic/src/lib/str.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ kernel/generic/src/lib/str.c	(revision f1380b76772fb5d1aa03637b5e57bd9b929fea61)
@@ -151,13 +151,13 @@
 	if (*offset + 1 > size)
 		return 0;
-	
+
 	/* First byte read from string */
 	uint8_t b0 = (uint8_t) str[(*offset)++];
-	
+
 	/* Determine code length */
-	
+
 	unsigned int b0_bits;  /* Data bits in first byte */
 	unsigned int cbytes;   /* Number of continuation bytes */
-	
+
 	if ((b0 & 0x80) == 0) {
 		/* 0xxxxxxx (Plain ASCII) */
@@ -180,23 +180,23 @@
 		return U_SPECIAL;
 	}
-	
+
 	if (*offset + cbytes > size)
 		return U_SPECIAL;
-	
+
 	wchar_t ch = b0 & LO_MASK_8(b0_bits);
-	
+
 	/* Decode continuation bytes */
 	while (cbytes > 0) {
 		uint8_t b = (uint8_t) str[(*offset)++];
-		
+
 		/* Must be 10xxxxxx */
 		if ((b & 0xc0) != 0x80)
 			return U_SPECIAL;
-		
+
 		/* Shift data bits to ch */
 		ch = (ch << CONT_BITS) | (wchar_t) (b & LO_MASK_8(CONT_BITS));
 		cbytes--;
 	}
-	
+
 	return ch;
 }
@@ -221,17 +221,17 @@
 	if (*offset >= size)
 		return EOVERFLOW;
-	
+
 	if (!chr_check(ch))
 		return EINVAL;
-	
+
 	/* Unsigned version of ch (bit operations should only be done
 	   on unsigned types). */
 	uint32_t cc = (uint32_t) ch;
-	
+
 	/* Determine how many continuation bytes are needed */
-	
+
 	unsigned int b0_bits;  /* Data bits in first byte */
 	unsigned int cbytes;   /* Number of continuation bytes */
-	
+
 	if ((cc & ~LO_MASK_32(7)) == 0) {
 		b0_bits = 7;
@@ -250,9 +250,9 @@
 		return EINVAL;
 	}
-	
+
 	/* Check for available space in buffer */
 	if (*offset + cbytes >= size)
 		return EOVERFLOW;
-	
+
 	/* Encode continuation bytes */
 	unsigned int i;
@@ -261,11 +261,11 @@
 		cc = cc >> CONT_BITS;
 	}
-	
+
 	/* Encode first byte */
 	str[*offset] = (cc & LO_MASK_32(b0_bits)) | HI_MASK_8(8 - b0_bits - 1);
-	
+
 	/* Advance offset */
 	*offset += cbytes + 1;
-	
+
 	return EOK;
 }
@@ -284,8 +284,8 @@
 {
 	size_t size = 0;
-	
+
 	while (*str++ != 0)
 		size++;
-	
+
 	return size;
 }
@@ -323,12 +323,12 @@
 	size_t len = 0;
 	size_t offset = 0;
-	
+
 	while (len < max_len) {
 		if (str_decode(str, &offset, STR_NO_LIMIT) == 0)
 			break;
-		
+
 		len++;
 	}
-	
+
 	return offset;
 }
@@ -363,8 +363,8 @@
 	size_t len = 0;
 	size_t offset = 0;
-	
+
 	while (str_decode(str, &offset, STR_NO_LIMIT) != 0)
 		len++;
-	
+
 	return len;
 }
@@ -380,8 +380,8 @@
 {
 	size_t len = 0;
-	
+
 	while (*wstr++ != 0)
 		len++;
-	
+
 	return len;
 }
@@ -399,8 +399,8 @@
 	size_t len = 0;
 	size_t offset = 0;
-	
+
 	while (str_decode(str, &offset, size) != 0)
 		len++;
-	
+
 	return len;
 }
@@ -419,10 +419,10 @@
 	size_t limit = ALIGN_DOWN(size, sizeof(wchar_t));
 	size_t offset = 0;
-	
+
 	while ((offset < limit) && (*str++ != 0)) {
 		len++;
 		offset += sizeof(wchar_t);
 	}
-	
+
 	return len;
 }
@@ -437,5 +437,5 @@
 	if (WCHAR_SIGNED_CHECK(ch >= 0) && (ch <= 127))
 		return true;
-	
+
 	return false;
 }
@@ -450,5 +450,5 @@
 	if (WCHAR_SIGNED_CHECK(ch >= 0) && (ch <= 1114111))
 		return true;
-	
+
 	return false;
 }
@@ -476,5 +476,5 @@
 	wchar_t c1 = 0;
 	wchar_t c2 = 0;
-	
+
 	size_t off1 = 0;
 	size_t off2 = 0;
@@ -486,5 +486,5 @@
 		if (c1 < c2)
 			return -1;
-		
+
 		if (c1 > c2)
 			return 1;
@@ -523,8 +523,8 @@
 	wchar_t c1 = 0;
 	wchar_t c2 = 0;
-	
+
 	size_t off1 = 0;
 	size_t off2 = 0;
-	
+
 	size_t len = 0;
 
@@ -569,8 +569,8 @@
 	assert(size > 0);
 	assert(src != NULL);
-	
+
 	size_t src_off = 0;
 	size_t dest_off = 0;
-	
+
 	wchar_t ch;
 	while ((ch = str_decode(src, &src_off, STR_NO_LIMIT)) != 0) {
@@ -578,5 +578,5 @@
 			break;
 	}
-	
+
 	dest[dest_off] = '\0';
 }
@@ -602,8 +602,8 @@
 	/* There must be space for a null terminator in the buffer. */
 	assert(size > 0);
-	
+
 	size_t src_off = 0;
 	size_t dest_off = 0;
-	
+
 	wchar_t ch;
 	while ((ch = str_decode(src, &src_off, n)) != 0) {
@@ -611,5 +611,5 @@
 			break;
 	}
-	
+
 	dest[dest_off] = '\0';
 }
@@ -636,5 +636,5 @@
 	char *dest = malloc(size, 0);
 	assert(dest);
-	
+
 	str_cpy(dest, size, src);
 	return dest;
@@ -666,8 +666,8 @@
 	if (size > n)
 		size = n;
-	
+
 	char *dest = malloc(size + 1, 0);
 	assert(dest);
-	
+
 	str_ncpy(dest, size + 1, src, size);
 	return dest;
@@ -695,5 +695,5 @@
 	src_idx = 0;
 	dest_off = 0;
-	
+
 	while ((ch = src[src_idx++]) != 0) {
 		if (chr_encode(ch, dest, &dest_off, size - 1) != EOK)
@@ -717,5 +717,5 @@
 	size_t off = 0;
 	size_t last = 0;
-	
+
 	while ((acc = str_decode(str, &off, STR_NO_LIMIT)) != 0) {
 		if (acc == ch)
@@ -723,5 +723,5 @@
 		last = off;
 	}
-	
+
 	return NULL;
 }
@@ -744,14 +744,14 @@
 {
 	size_t len = wstr_length(str);
-	
+
 	if ((pos > len) || (pos + 1 > max_pos))
 		return false;
-	
+
 	size_t i;
 	for (i = len; i + 1 > pos; i--)
 		str[i + 1] = str[i];
-	
+
 	str[pos] = ch;
-	
+
 	return true;
 }
@@ -772,12 +772,12 @@
 {
 	size_t len = wstr_length(str);
-	
+
 	if (pos >= len)
 		return false;
-	
+
 	size_t i;
 	for (i = pos + 1; i <= len; i++)
 		str[i - 1] = str[i];
-	
+
 	return true;
 }
@@ -800,12 +800,12 @@
 	assert(neg != NULL);
 	assert(result != NULL);
-	
+
 	*neg = false;
 	const char *str = nptr;
-	
+
 	/* Ignore leading whitespace */
 	while (isspace(*str))
 		str++;
-	
+
 	if (*str == '-') {
 		*neg = true;
@@ -813,13 +813,13 @@
 	} else if (*str == '+')
 		str++;
-	
+
 	if (base == 0) {
 		/* Decode base if not specified */
 		base = 10;
-		
+
 		if (*str == '0') {
 			base = 8;
 			str++;
-			
+
 			switch (*str) {
 			case 'b':
@@ -856,11 +856,11 @@
 		}
 	}
-	
+
 	*result = 0;
 	const char *startstr = str;
-	
+
 	while (*str != 0) {
 		unsigned int digit;
-		
+
 		if ((*str >= 'a') && (*str <= 'z'))
 			digit = *str - 'a' + 10;
@@ -871,11 +871,11 @@
 		else
 			break;
-		
+
 		if (digit >= base)
 			break;
-		
+
 		uint64_t prev = *result;
 		*result = (*result) * base + digit;
-		
+
 		if (*result < prev) {
 			/* Overflow */
@@ -883,8 +883,8 @@
 			return EOVERFLOW;
 		}
-		
+
 		str++;
 	}
-	
+
 	if (str == startstr) {
 		/*
@@ -894,10 +894,10 @@
 		str = nptr;
 	}
-	
+
 	*endptr = (char *) str;
-	
+
 	if (str == nptr)
 		return EINVAL;
-	
+
 	return EOK;
 }
@@ -919,24 +919,24 @@
 {
 	assert(result != NULL);
-	
+
 	bool neg;
 	char *lendptr;
 	errno_t ret = str_uint(nptr, &lendptr, base, &neg, result);
-	
+
 	if (endptr != NULL)
 		*endptr = (char *) lendptr;
-	
+
 	if (ret != EOK)
 		return ret;
-	
+
 	/* Do not allow negative values */
 	if (neg)
 		return EINVAL;
-	
+
 	/* Check whether we are at the end of
 	   the string in strict mode */
 	if ((strict) && (*lendptr != 0))
 		return EINVAL;
-	
+
 	return EOK;
 }
