fix check for null terminator

This commit is contained in:
Dave Murphy 2014-11-21 17:00:31 +00:00
parent 3375e8fc58
commit d468306a18
2 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ export TOPDIR := $(CURDIR)
export LIBFAT_MAJOR := 1 export LIBFAT_MAJOR := 1
export LIBFAT_MINOR := 0 export LIBFAT_MINOR := 0
export LIBFAT_PATCH := 12 export LIBFAT_PATCH := 13
export VERSTRING := $(LIBFAT_MAJOR).$(LIBFAT_MINOR).$(LIBFAT_PATCH) export VERSTRING := $(LIBFAT_MAJOR).$(LIBFAT_MINOR).$(LIBFAT_PATCH)

View File

@ -125,7 +125,7 @@ static size_t _FAT_directory_mbstoucs2 (ucs2_t* dst, const char* src, size_t len
int bytes; int bytes;
size_t count = 0; size_t count = 0;
while (count < len-1 && src != '\0') { while (count < len-1 && *src != '\0') {
bytes = mbrtowc (&tempChar, src, MB_CUR_MAX, &ps); bytes = mbrtowc (&tempChar, src, MB_CUR_MAX, &ps);
if (bytes > 0) { if (bytes > 0) {
*dst = (ucs2_t)tempChar; *dst = (ucs2_t)tempChar;