Change-Id: I394edd2a6a97801f6bcb0d4dde783c9a526e5456
return 0;
int count;
- if (wc < 0x80) { // most offen case
+ if (wc < 0)
+ return RET_ILSEQ;
+ else if (wc < 0x80) { // most offen case
if (dest_size < 1)
return RET_TOOSMALL;
dest[0] = wc;
count = 4;
else if (wc < 0x4000000)
count = 5;
- else if (wc <= 0x7fffffff)
+ else //if (wc <= 0x7fffffff)
count = 6;
- else
- return RET_ILSEQ;
+
if (dest_size < count)
return RET_TOOSMALL;
switch (count) { /* note: code falls through cases! */