1 | /* |
1 | /* |
2 | unicode.c - Part of psiconv, a PSION 5 file formats converter |
2 | unicode.c - Part of psiconv, a PSION 5 file formats converter |
3 | Copyright (c) 2003 Frodo Looijaard <frodol@dds.nl> |
3 | Copyright (c) 2003-2004 Frodo Looijaard <frodol@dds.nl> |
4 | |
4 | |
5 | This program is free software; you can redistribute it and/or modify |
5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by |
6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or |
7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. |
8 | (at your option) any later version. |
… | |
… | |
109 | psiconv_ucs2 **output) |
109 | psiconv_ucs2 **output) |
110 | { |
110 | { |
111 | int i; |
111 | int i; |
112 | if (!output) |
112 | if (!output) |
113 | return PSICONV_E_NOMEM; |
113 | return PSICONV_E_NOMEM; |
114 | if (!(*output = malloc(sizeof(**output) * (1 + strlen(input))))) |
114 | if (!(*output = malloc(sizeof(**output) * (1 + strlen((const char *) input))))) |
115 | return PSICONV_E_NOMEM; |
115 | return PSICONV_E_NOMEM; |
116 | for (i = 0; i < strlen(input); i++) |
116 | for (i = 0; i < strlen((const char *) input); i++) |
117 | (*output)[i] = psiconv_unicode_from_char(config,input[i]); |
117 | (*output)[i] = psiconv_unicode_from_char(config,input[i]); |
118 | (*output)[i] = 0x0000; |
118 | (*output)[i] = 0x0000; |
119 | return PSICONV_E_OK; |
119 | return PSICONV_E_OK; |
120 | } |
120 | } |
121 | |
121 | |