mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-21 03:13:42 +08:00
Fix bug in utf8 -> utf16 conversion with ncgen -l java.
re: issue https://github.com/Unidata/netcdf-c/issues/1171 ncgen was checking validity of the utf8->utf16 conversion incorrectly.
This commit is contained in:
parent
8d5e66ec5f
commit
a2c3ae18ed
@ -153,9 +153,9 @@ int nc_utf8_to_utf16(const unsigned char* s8, unsigned short** utf16p, size_t* l
|
||||
goto done;
|
||||
} else { /* move to next char */
|
||||
/* Complain if top 16 bits not zero */
|
||||
if((codepoint & 0x0000FFFF) != 0) {
|
||||
ncstat = NC_EBADNAME;
|
||||
goto done;
|
||||
if((codepoint & 0xFFFF0000) != 0) {
|
||||
ncstat = NC_EBADNAME;
|
||||
goto done;
|
||||
}
|
||||
/* Truncate codepoint to 16 bits and store */
|
||||
*p16++ = (unsigned short)(codepoint & 0x0000FFFF);
|
||||
|
Loading…
Reference in New Issue
Block a user