-rw-r--r-- | parsing.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -94,25 +94,28 @@ char *parse_user(char *t, char **name, char **email, unsigned long *date) p++; } return p; } #ifdef NO_ICONV #define reencode(a, b, c) #else const char *reencode(char **txt, const char *src_enc, const char *dst_enc) { char *tmp; - if (!txt || !*txt || !src_enc || !dst_enc) + if (!txt) + return NULL; + + if (!*txt || !src_enc || !dst_enc) return *txt; /* no encoding needed if src_enc equals dst_enc */ if(!strcasecmp(src_enc, dst_enc)) return *txt; tmp = reencode_string(*txt, dst_enc, src_enc); if (tmp) { free(*txt); *txt = tmp; } return *txt; |