+Sun Jun 23 17:32:31 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
+
+ * Don't do SILC_STRING_LANGUAGE encoding if the outbuffer
+ is NULL since seems that on some platforms NULL is allowed
+ and on some it's not. Fallback encoding is used instead.
+ Affected file lib/silcutil/silcstrutil.c.
+
Sat Jun 22 21:34:59 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
* Added silc_client_udpate_server function to update changed
ocp = (char *)utf8;
inlen = bin_len;
outlen = utf8_size;
- if (icd != (iconv_t)-1 &&
- (iconv(icd, &icp, &inlen, &ocp, &outlen) != -1)) {
- utf8_size -= outlen;
- iconv_close(icd);
- return utf8_size;
- } else {
- if (icd != (iconv_t)-1)
+ if (icp && ocp && icd != (iconv_t)-1) {
+ if (iconv(icd, &icp, &inlen, &ocp, &outlen) != -1) {
+ utf8_size -= outlen;
iconv_close(icd);
+ return utf8_size;
+ }
+ iconv_close(icd);
}
}
#endif
ocp = (char *)bin;
inlen = utf8_len;
outlen = bin_size;
- if (icd != (iconv_t)-1 &&
- (iconv(icd, &icp, &inlen, &ocp, &outlen) != -1)) {
- bin_size -= outlen;
- iconv_close(icd);
- return bin_size;
- } else {
- if (icd != (iconv_t)-1)
+ if (icp && ocp && icd != (iconv_t)-1) {
+ if (iconv(icd, &icp, &inlen, &ocp, &outlen) != -1) {
+ bin_size -= outlen;
iconv_close(icd);
+ return bin_size;
+ }
+ iconv_close(icd);
}
}
#endif