/[jscoverage]/trunk/encoding.c
ViewVC logotype

Diff of /trunk/encoding.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 297 by siliconforks, Sun Oct 12 22:57:14 2008 UTC revision 313 by siliconforks, Mon Oct 13 17:52:20 2008 UTC
# Line 278  Line 278 
278    
279    *characters = xnew(jschar, num_bytes);    *characters = xnew(jschar, num_bytes);
280    
281    int result = MultiByteToWideChar(code_page, 0, bytes, num_bytes, *characters, num_bytes);    int result = MultiByteToWideChar(code_page, MB_ERR_INVALID_CHARS, bytes, num_bytes, *characters, num_bytes);
282    if (result == 0) {    if (result == 0) {
283      free(*characters);      free(*characters);
284      return JSCOVERAGE_ERROR_INVALID_BYTE_SEQUENCE;      return JSCOVERAGE_ERROR_INVALID_BYTE_SEQUENCE;
# Line 300  Line 300 
300    
301    jschar * c = xnew(jschar, num_bytes);    jschar * c = xnew(jschar, num_bytes);
302    for (size_t i = 0; i < num_bytes; i++) {    for (size_t i = 0; i < num_bytes; i++) {
303      if (bytes[i]) > 127) {      if (bytes[i] > 127) {
304        free(c);        free(c);
305        return JSCOVERAGE_ERROR_ENCODING_NOT_SUPPORTED;        return JSCOVERAGE_ERROR_ENCODING_NOT_SUPPORTED;
306      }      }

Legend:
Removed from v.297  
changed lines
  Added in v.313

  ViewVC Help
Powered by ViewVC 1.1.24