1 | /* |
1 | /* |
2 | gen_html.c - Part of psiconv, a PSION 5 file formats converter |
2 | gen_html.c - Part of psiconv, a PSION 5 file formats converter |
3 | Copyright (c) 1999-2004 Frodo Looijaard <frodol@dds.nl> |
3 | Copyright (c) 1999-2005 Frodo Looijaard <frodo@frodo.looijaard.name> |
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. |
… | |
… | |
245 | if (len) { |
245 | if (len) { |
246 | if (!(text = malloc(sizeof (*text) * (len + 1)))) { |
246 | if (!(text = malloc(sizeof (*text) * (len + 1)))) { |
247 | fputs("Out of memory error\n",stderr); |
247 | fputs("Out of memory error\n",stderr); |
248 | exit(1); |
248 | exit(1); |
249 | } |
249 | } |
250 | memcpy(text,para->text+charnr,len * sizeof(*text)); |
250 | memcpy(text,para->text+start,len * sizeof(*text)); |
251 | text[len] = 0; |
251 | text[len] = 0; |
252 | characters(config,list,text,layout->layout,enc); |
252 | characters(config,list,text,layout->layout,enc); |
253 | free(text); |
253 | free(text); |
254 | } |
254 | } |
255 | charnr += layout->length; |
255 | charnr += layout->length; |