… | |
… | |
142 | |
142 | |
143 | int psiconv_unicode_write_char(const psiconv_config config, |
143 | int psiconv_unicode_write_char(const psiconv_config config, |
144 | psiconv_buffer buf, |
144 | psiconv_buffer buf, |
145 | int lev, psiconv_ucs2 value) |
145 | int lev, psiconv_ucs2 value) |
146 | { |
146 | { |
147 | psiconv_u8 byte; |
|
|
148 | int i; |
147 | int i; |
149 | int res=0; |
148 | int res=0; |
150 | |
149 | |
151 | if (config->unicode) { |
150 | if (config->unicode) { |
152 | if (value < 0x80) { |
151 | if (value < 0x80) { |
… | |
… | |
262 | for (i = 0; i < haystack_len - needle_len + 1; i++) { |
261 | for (i = 0; i < haystack_len - needle_len + 1; i++) { |
263 | for (j = 0; j < needle_len; j++) |
262 | for (j = 0; j < needle_len; j++) |
264 | if (haystack[i+j] != needle[j]) |
263 | if (haystack[i+j] != needle[j]) |
265 | break; |
264 | break; |
266 | if (j == needle_len) |
265 | if (j == needle_len) |
267 | return haystack+i; |
266 | return (psiconv_ucs2 *) haystack+i; |
268 | } |
267 | } |
269 | return NULL; |
268 | return NULL; |
270 | } |
269 | } |