patch-2.4.9 linux/fs/isofs/joliet.c

Next file: linux/fs/isofs/rock.c
Previous file: linux/fs/isofs/inode.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.8/linux/fs/isofs/joliet.c linux/fs/isofs/joliet.c
@@ -10,6 +10,7 @@
 #include <linux/nls.h>
 #include <linux/slab.h>
 #include <linux/iso_fs.h>
+#include <asm/unaligned.h>
 
 /*
  * Convert Unicode 16 to UTF8 or ASCII.
@@ -17,15 +18,15 @@
 static int
 uni16_to_x8(unsigned char *ascii, u16 *uni, int len, struct nls_table *nls)
 {
-	wchar_t *ip;
+	wchar_t *ip, ch;
 	unsigned char *op;
 
 	ip = uni;
 	op = ascii;
 
-	while (*ip && len) {
+	while ((ch = get_unaligned(ip)) && len) {
 		int llen;
-		wchar_t ch = be16_to_cpu(*ip);
+		ch = be16_to_cpu(ch);
 		if ((llen = nls->uni2char(ch, op, NLS_MAX_CHARSET_SIZE)) > 0)
 			op += llen;
 		else

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)