diff options
author | root <root> | 2007-09-09 22:29:50 +0000 |
---|---|---|
committer | root <root> | 2007-09-09 22:29:50 +0000 |
commit | a501062f338339d1dbafebc55841cbdc570a27b6 (patch) | |
tree | 4f314db4049d665fc3a0acacbbbec4ee803159e6 /src/util.c | |
parent | b013532b3061cc661ee9d0b141efbc86cda5c320 (diff) | |
download | gpt-a501062f338339d1dbafebc55841cbdc570a27b6.tar.gz gpt-a501062f338339d1dbafebc55841cbdc570a27b6.tar.bz2 gpt-a501062f338339d1dbafebc55841cbdc570a27b6.zip |
*** empty log message ***
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -52,4 +52,25 @@ hexdump (FILE * f, uint8_t * data, int s, int l) } +void utf16_to_ascii(uint16_t *u16,int u16_len,uint8_t *u8, int u8_len) +{ +u16_len >>=1; + +if (u8_len==1) { + *u8=0; + return; +} +while (*u16 && u16_len) { +*(u8++)=*(u16++); +u16_len--; +u8_len--; +if (u8_len==1) { + *u8=0; + return; +} +} + + *u8=0; + return; +} |