This website works better with JavaScript.
Home
Explore
Sign In
mahta.fetrat
/
HomoFast-eSpeak-Persian
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Releases
0
Wiki
Activity
Browse Source
Cope with truncated utf8 input
master
Samuel Thibault
3 years ago
parent
53348c5118
commit
ecec635b44
1 changed files
with
6 additions
and
0 deletions
Split View
Show Diff Stats
6
0
src/libespeak-ng/translate.c
+ 6
- 0
src/libespeak-ng/translate.c
View File
@@ -301,7 +301,13 @@ int utf8_in2(int *c, const char *buf, int backwards)
c1 &= mask[n_bytes];
for (ix = 0; ix < n_bytes; ix++)
{
if (!*buf)
/* Oops, truncated */
break;
c1 = (c1 << 6) + (*buf++ & 0x3f);
}
n_bytes = ix;
}
*c = c1;
return n_bytes+1;
Write
Preview
Loading…
Cancel
Save