diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2013-11-14 19:45:49 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2013-11-14 19:45:49 +0100 |
commit | e92fff16d1d364f544a4f597883fbf31e80f94b9 (patch) | |
tree | cae61b7879b7feafc158815102e2e3e966f923fb | |
parent | 462cd145b8544a2f529d5bc188e6782c6043afd1 (diff) | |
download | librcc-e92fff16d1d364f544a4f597883fbf31e80f94b9.tar.gz librcc-e92fff16d1d364f544a4f597883fbf31e80f94b9.tar.bz2 librcc-e92fff16d1d364f544a4f597883fbf31e80f94b9.tar.xz librcc-e92fff16d1d364f544a4f597883fbf31e80f94b9.zip |
Fix complaining in example
-rw-r--r-- | .bzrignore | 1 | ||||
-rw-r--r-- | ToDo | 3 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | examples/example2.c | 7 |
4 files changed, 10 insertions, 3 deletions
@@ -44,3 +44,4 @@ CMakeCache.txt rcc-gtk3-config librcc.pc ar-lib +src/.dirstamp @@ -10,6 +10,9 @@ - Solve mpg123 slowdown. 0.3.x: + - Shall we always return result even if recoding is not required (not a NULL as now)? + Currently we have no way to know if something is failed or if we just have a correct + string already... - Language and Encoding autodetection improvements. + LibRCD should use DB4 with statistic for different languages + The statistic should be gathered using: @@ -1 +1 @@ -0.2.11CVS +0.2.11 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(); |