Changeset 705


Ignore:
Timestamp:
Nov 12, 2010, 11:29:51 AM (8 years ago)
Author:
cameron
Message:

Error handling - end of buffer hack.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/u8u16/template.c

    r648 r705  
    182182          u8advance -= 3;
    183183          /* May have already first of a surrogate pair to targetbuf. */
    184           if (u8advance == -3) *targetbuf -= 2;
     184          if (u8advance == -3) *targetbuf -= 1;
    185185        }
    186186        else if (bitblock_has_bit(simd_and(strct_u8__scope43_, errbit))) {
     
    244244      if (error_found) return;
    245245    }
    246 
     246    if (test_carry(carry5)) /* scope44 pending */ {
     247      *srcbuf -= 3;
     248      *targetbuf -= 1;
     249      *err = U_TRUNCATED_CHAR_FOUND;
     250    }
     251    else if (test_carry(carry_or(carry2,carry4))) {
     252      /* scope33 or scope43 pending */
     253      *srcbuf -= 2;
     254      *err = U_TRUNCATED_CHAR_FOUND;
     255    }
     256    else if (test_carry(carry_or(carry0,carry_or(carry1, carry3)))) {
     257      /* scope22, scope32 or scope42 pending */
     258      *srcbuf -= 1;
     259      *err = U_TRUNCATED_CHAR_FOUND;
     260    }
     261    else *err = U_ZERO_ERROR;
    247262}
    248263
Note: See TracChangeset for help on using the changeset viewer.