Processing in wide-byte characters is not a good idea.Now I fix it by totally rewrite it without converting to wide-byte characters,It's in the attachment,have a try:)
Now I fix it by totally rewrite it without converting to wide-byte characters,It's in the attachment,have a try:)
the len variable returned in line 51len = mbstowcs (NULL, path, 0) function is different to the len parameter in line 57 mbstowcs( refpath, path, len) function,the former is about wide byte characters needed, the latter is about multiplebyte characters needed,the original programmer confused them In many places (though in "C" locale they have the same value),so cause the truncation.
the len variable returned in line 51len = mbstowcs (NULL, path, 0) function is different to the len variable in line 57 mbstowcs( refpath, path, len) function,the former is about wide byte characters needed, the latter is about multiplebyte characters needed,the original programmer confused them In many places (though in "C" locale they have the same value),so cause the truncation.
the len variable in line 51len = mbstowcs (NULL, path, 0) is different to the len variable in line 57 mbstowcs( refpath, path, len),the former is about wide byte characters needed, the latter is about multiplebyte characters needed,the original programmer confused them In many places (though in "C" locale they have the same value),so cause the truncation.
the len variable in len = mbstowcs (NULL, path, 0) is different to the len variable in mbstowcs( refpath, path, len),the former is about wide byte characters needed, the latter is about multiplebyte characters needed,the original programmer confused them(though in "C" locale they have the same value),so cause the truncation.
the len variable in len = mbstowcs (NULL, path, 0) is different to the len variable in mbstowcs( refpath, path, len),former is about wide byte characters needed,latter is about multiplebyte characters needed,the original programmer confused them(though in "C" locale they have the same value),so cause the truncation.
the len variable in len = mbstowcs (NULL, path, 0) is different to the len variable in mbstowcs( refpath, path, len),former is about wide byte characters needed,latter is about multiplebyte characters needed,the original programmer confused them,so cause the truncation.