projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(dump_free) For SBC_DBL_LIST, enclose the output code in curly braces,
[pspp]
/
src
/
libpspp
/
i18n.c
diff --git
a/src/libpspp/i18n.c
b/src/libpspp/i18n.c
index bcac52cf58b35b062aa6a45503887d84cc68c780..360c9abd3145ca6cc64a66996bfe309d164fa624 100644
(file)
--- a/
src/libpspp/i18n.c
+++ b/
src/libpspp/i18n.c
@@
-54,6
+54,9
@@
recode_string(enum conv_id how, const char *text, int length)
/* FIXME: Need to ensure that this char is valid in the target encoding */
const char fallbackchar = '?';
/* FIXME: Need to ensure that this char is valid in the target encoding */
const char fallbackchar = '?';
+ if ( text == NULL )
+ return NULL;
+
if ( length == -1 )
length = strlen(text);
if ( length == -1 )
length = strlen(text);
@@
-71,8
+74,6
@@
recode_string(enum conv_id how, const char *text, int length)
inbytes = length;
do {
inbytes = length;
do {
-
-
result = iconv(convertor[how], &ip, &inbytes,
&op, &outbytes);
result = iconv(convertor[how], &ip, &inbytes,
&op, &outbytes);
@@
-108,11
+109,17
@@
recode_string(enum conv_id how, const char *text, int length)
}
}
}
}
-
} while ( -1 == result );
} while ( -1 == result );
+ if (outbytes == 0 )
+ {
+ char *const oldaddr = outbuf;
+ outbuf = xrealloc(outbuf, outbufferlength + 1);
+
+ op += (outbuf - oldaddr) ;
+ }
+
*op = '\0';
*op = '\0';
-
return outbuf;
}
return outbuf;
}