X-Git-Url: http://git.dolda2000.com/gitweb/?a=blobdiff_plain;f=daemon%2Futils.c;h=d084db6c82e98aed3e1e880fea0ccc2f66ed4d1b;hb=96cf7d1f9a98dfbb68c8cfd47f3b774da7306b8b;hp=878fb61b4280b6648c4d54dd48dcf7b78194dad8;hpb=6431aca05e3425df8ac4c2ed4e621d191f01425f;p=doldaconnect.git diff --git a/daemon/utils.c b/daemon/utils.c index 878fb61..d084db6 100644 --- a/daemon/utils.c +++ b/daemon/utils.c @@ -190,7 +190,7 @@ wchar_t *icsmbstowcs(char *mbs, char *charset, wchar_t *def) free(buf); if((buf = icmbstowcs(mbs, charset)) == NULL) { - if(*def == '~') + if((def != NULL) && (*def == L'~')) { flog(LOG_WARNING, "icsmbstowcs: could not convert wcs string into charset %s: %s", charset, strerror(errno)); def++; @@ -264,7 +264,7 @@ char *icswcstombs(wchar_t *wcs, char *charset, char *def) free(buf); if((buf = icwcstombs(wcs, charset)) == NULL) { - if(*def == '~') + if((def != NULL) && (*def == '~')) { flog(LOG_WARNING, "icswcstombs: could not convert mbs string from charset %s: %s", charset, strerror(errno)); def++;