Changes by: mattjf
Update of /cvsroot/linux-ntfs/linux-ntfs/libntfs
In directory usw-pr-cvs1:/tmp/cvs-serv10655/libntfs
Modified Files:
unistr.c
Log Message:
ntfslabel - Coverted stoucs to ntfs_mbstoucs()
- code cleanup
- better error checking
unistr.c - removed size_t casts from ntfs_mbstoucs()
Index: unistr.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/libntfs/unistr.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -U2 -r1.12 -r1.13
--- unistr.c 18 Apr 2002 17:20:05 -0000 1.12
+++ unistr.c 28 Apr 2002 21:20:27 -0000 1.13
@@ -319,5 +319,5 @@
}
tc = (char*)malloc((mbs_len + 64) & ~63);
- if (!tc)
+ if (!tc)
goto err_out;
memcpy(tc, mbs, mbs_len);
@@ -395,5 +395,5 @@
Dprintf(__FUNCTION__ "(): MB_CUR_MAX = %i\n", MB_CUR_MAX);
- if (!ins || !outs) {
+ if (!ins || !outs) {
errno = EINVAL;
return -1;
@@ -427,5 +427,6 @@
tc = (uchar_t*)malloc((ucs_len + 64) & ~63);
if (!tc)
- goto err_out;
+ goto err_out;
+
memcpy(tc, ucs, ucs_len);
ucs_len = ((ucs_len + 64) & ~63) / sizeof(uchar_t);
@@ -437,7 +438,9 @@
if (!cnt)
break;
- if (cnt == (size_t)-1)
+ if (cnt == -1) {
+ Dprintf("cnt = %i\n",cnt);
goto err_out;
- else if (cnt < (size_t)-1) {
+ }
+ else if (cnt < -1) {
Dprintf("Eeek. cnt = %i\n", cnt);
errno = EINVAL;
|