projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
compile without multibyte support
[rrdtool.git]
/
src
/
rrd_gfx.c
diff --git
a/src/rrd_gfx.c
b/src/rrd_gfx.c
index
c56211d
..
a71d43a
100644
(file)
--- a/
src/rrd_gfx.c
+++ b/
src/rrd_gfx.c
@@
-1062,7
+1062,9
@@
static void svg_write_text(FILE *fp, const char *text)
text_count = mbstowcs(cstr, "Enc-Err", 6);
p = cstr;
#else
text_count = mbstowcs(cstr, "Enc-Err", 6);
p = cstr;
#else
- const unsigned char *p = text, ch;
+ unsigned char *p = text;
+ unsigned char *cstr;
+ char ch;
if (!p)
return;
#endif
if (!p)
return;
#endif
@@
-1071,7
+1073,7
@@
static void svg_write_text(FILE *fp, const char *text)
ch = afm_fix_osx_charset(ch); /* unsafe macro */
switch (ch) {
case 0:
ch = afm_fix_osx_charset(ch); /* unsafe macro */
switch (ch) {
case 0:
-#ifdef HAVE_MBSTOWCS
+#ifdef HAVE_MBSTOWCS
free(cstr);
#endif
return;
free(cstr);
#endif
return;
@@
-1081,7
+1083,7
@@
static void svg_write_text(FILE *fp, const char *text)
case '"': fputs(""", fp); break;
default:
if (ch == 32) {
case '"': fputs(""", fp); break;
default:
if (ch == 32) {
-#ifdef HAVE_MBSTOWCS
+#ifdef HAVE_MBSTOWCS
if (p <= cstr + 1 || !*p || *p == 32)
fputs(" ", fp); /* non-breaking space in unicode */
else
if (p <= cstr + 1 || !*p || *p == 32)
fputs(" ", fp); /* non-breaking space in unicode */
else
@@
-1747,7
+1749,8
@@
static void eps_write_text(eps_state *state, gfx_node_t *node)
text_count = mbstowcs(cstr, "Enc-Err", 6);
p = cstr;
#else
text_count = mbstowcs(cstr, "Enc-Err", 6);
p = cstr;
#else
- const unsigned char *p = node->text, ch;
+ const unsigned char *p = node->text;
+ unsigned char ch;
if (!p)
return;
#endif
if (!p)
return;
#endif
@@
-2034,9
+2037,9
@@
static void pdf_put_string_contents_wide(pdf_buffer *buf, const afm_char *text)
default:
if (ch > 255) {
pdf_put_char(buf, '?');
default:
if (ch > 255) {
pdf_put_char(buf, '?');
- } else if (ch >
= 126
|| ch < 32) {
+ } else if (ch >
125
|| ch < 32) {
pdf_put_char(buf, ch);
pdf_put_char(buf, ch);
- } else
if (ch >= 0 && ch <= 255)
{
+ } else {
char tmp[10];
snprintf(tmp, sizeof(tmp), "\\%03o", (int)ch);
pdf_puts(buf, tmp);
char tmp[10];
snprintf(tmp, sizeof(tmp), "\\%03o", (int)ch);
pdf_puts(buf, tmp);