Index: uspace/lib/c/generic/str.c
===================================================================
--- uspace/lib/c/generic/str.c	(revision 2628642fbacaaace0098326703f7d066483e2760)
+++ uspace/lib/c/generic/str.c	(revision b06414f03a4dbc34fce671630eb087b869763bfc)
@@ -951,5 +951,17 @@
 }
 
-int str_to_utf16(uint16_t *dest, size_t size, const char *src)
+/** Convert string to UTF16 string.
+ *
+ * Convert string @a src to utf16 string. The output is written to the buffer
+ * specified by @a dest and @a dlen. @a dlen must be non-zero and the string
+ * written will always be well-formed. Surrogate pairs also supported.
+ *
+ * @param dest	Destination buffer.
+ * @param dlen	Number of utf16 characters that fit in the destination buffer.
+ * @param src	Source string.
+ *
+ * @return EOK, if success, negative otherwise.
+ */
+int str_to_utf16(uint16_t *dest, size_t dlen, const char *src)
 {
 	int rc = EOK;
@@ -958,9 +970,9 @@
 	wchar_t c;
 
-	assert(size > 0);
+	assert(dlen > 0);
 	
 	while ((c = str_decode(src, &offset, STR_NO_LIMIT)) != 0) {
 		if (c > 0x10000) {
-			if (idx + 2 >= size - 1) {
+			if (idx + 2 >= dlen - 1) {
 				rc = EOVERFLOW;
 				break;
@@ -975,5 +987,5 @@
 
 		idx++;
-		if (idx >= size - 1) {
+		if (idx >= dlen - 1) {
 			rc = EOVERFLOW;
 			break;
Index: uspace/lib/c/include/str.h
===================================================================
--- uspace/lib/c/include/str.h	(revision 2628642fbacaaace0098326703f7d066483e2760)
+++ uspace/lib/c/include/str.h	(revision b06414f03a4dbc34fce671630eb087b869763bfc)
@@ -98,5 +98,5 @@
 extern wchar_t *str_to_awstr(const char *src);
 extern int utf16_to_str(char *dest, size_t size, const uint16_t *src);
-extern int str_to_utf16(uint16_t *dest, size_t size, const char *src);
+extern int str_to_utf16(uint16_t *dest, size_t dlen, const char *src);
 
 extern char *str_chr(const char *str, wchar_t ch);
Index: uspace/srv/fs/fat/fat_dentry.h
===================================================================
--- uspace/srv/fs/fat/fat_dentry.h	(revision 2628642fbacaaace0098326703f7d066483e2760)
+++ uspace/srv/fs/fat/fat_dentry.h	(revision b06414f03a4dbc34fce671630eb087b869763bfc)
@@ -83,5 +83,6 @@
 #define FAT_LFN_CHKSUM(d) ((d)->lfn.check_sum)
 
-#define FAT_LFN_NAME_SIZE   260
+#define FAT_LFN_NAME_LEN    260                           /* characters */
+#define FAT_LFN_NAME_SIZE   STR_BOUNDS(FAT_LFN_NAME_LEN)  /* bytes */
 #define FAT_LFN_MAX_COUNT   20
 #define FAT_LFN_PART1_SIZE  5
Index: uspace/srv/fs/fat/fat_directory.c
===================================================================
--- uspace/srv/fs/fat/fat_directory.c	(revision 2628642fbacaaace0098326703f7d066483e2760)
+++ uspace/srv/fs/fat/fat_directory.c	(revision b06414f03a4dbc34fce671630eb087b869763bfc)
@@ -155,5 +155,5 @@
 {
 	fat_dentry_t *d = NULL;
-	uint16_t wname[FAT_LFN_NAME_SIZE];
+	uint16_t wname[FAT_LFN_NAME_LEN];
 	size_t lfn_offset, lfn_size;
 	bool long_entry = false;
@@ -293,8 +293,8 @@
 		int long_entry_count;
 		uint8_t checksum;
-		uint16_t wname[FAT_LFN_NAME_SIZE];
+		uint16_t wname[FAT_LFN_NAME_LEN];
 		size_t lfn_size, lfn_offset;
 		
-		rc = str_to_utf16(wname, FAT_LFN_NAME_SIZE, name);
+		rc = str_to_utf16(wname, FAT_LFN_NAME_LEN, name);
 		if (rc != EOK)
 			return rc;
