From e92fff16d1d364f544a4f597883fbf31e80f94b9 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Thu, 14 Nov 2013 19:45:49 +0100 Subject: Fix complaining in example --- examples/example2.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/example2.c b/examples/example2.c index 13c280e..f8b085c 100644 --- a/examples/example2.c +++ b/examples/example2.c @@ -65,14 +65,17 @@ int main(int argc, char *argv[]) { if (strlen(buf)<2) break; rccstring = rccFrom(NULL, 0, buf); + if (!rccstring) rccstring = strdup(buf); + if (rccstring) { recoded = rccTo(NULL, 1, rccstring); + if (!recoded) recoded = strdup(rccstring); if (recoded) { printf("%s", recoded); free(recoded); - } else printf("Recoding from UTF-8 is failed\n"); + } free(rccstring); - } else printf("Recoding to UTF-8 is failed\n"); + } } rccFree(); -- cgit v1.2.3