Browse Source

* Avoid useless call to strlen() in the exporters.

* Removed '\x0f' from the IRC exporter until I understand why it was here.
tags/v0.99.beta14
Sam Hocevar sam 18 years ago
parent
commit
83b4374fb4
5 changed files with 5 additions and 9 deletions
  1. +1
    -1
      cucul/export_ansi.c
  2. +1
    -1
      cucul/export_html.c
  3. +1
    -5
      cucul/export_irc.c
  4. +1
    -1
      cucul/export_ps.c
  5. +1
    -1
      cucul/export_svg.c

+ 1
- 1
cucul/export_ansi.c View File

@@ -99,7 +99,7 @@ void _cucul_get_ansi(cucul_t *qq, struct cucul_export *ex)
}

/* Crop to really used size */
ex->size = strlen(ex->buffer) + 1;
ex->size = (uintptr_t)(cur - ex->buffer);
ex->buffer = realloc(ex->buffer, ex->size);
}


+ 1
- 1
cucul/export_html.c View File

@@ -185,7 +185,7 @@ void _cucul_get_html3(cucul_t *qq, struct cucul_export *ex)
cur += sprintf(cur, "</table>\n");

/* Crop to really used size */
ex->size = strlen(ex->buffer) + 1;
ex->size = (uintptr_t)(cur - ex->buffer);
ex->buffer = realloc(ex->buffer, ex->size);
}



+ 1
- 5
cucul/export_irc.c View File

@@ -58,8 +58,6 @@ void _cucul_get_irc(cucul_t *qq, struct cucul_export *ex)

cur = ex->buffer;

*cur++ = '\x0f';

for(y = 0; y < qq->height; y++)
{
uint32_t *lineattr = qq->attr + y * qq->width;
@@ -105,9 +103,7 @@ void _cucul_get_irc(cucul_t *qq, struct cucul_export *ex)
*cur++ = '\n';
}

*cur++ = '\x0f';

/* Crop to really used size */
ex->size = strlen(ex->buffer) + 1;
ex->size = (uintptr_t)(cur - ex->buffer);
ex->buffer = realloc(ex->buffer, ex->size);
}

+ 1
- 1
cucul/export_ps.c View File

@@ -134,7 +134,7 @@ void _cucul_get_ps(cucul_t *qq, struct cucul_export *ex)
cur += sprintf(cur, "showpage\n");

/* Crop to really used size */
ex->size = strlen(ex->buffer) + 1;
ex->size = (uintptr_t)(cur - ex->buffer);
ex->buffer = realloc(ex->buffer, ex->size);
}


+ 1
- 1
cucul/export_svg.c View File

@@ -146,7 +146,7 @@ void _cucul_get_svg(cucul_t *qq, struct cucul_export *ex)
cur += sprintf(cur, "</svg>\n");

/* Crop to really used size */
ex->size = strlen(ex->buffer) + 1;
ex->size = (uintptr_t)(cur - ex->buffer);
ex->buffer = realloc(ex->buffer, ex->size);
}


Loading…
Cancel
Save