/rusxmms/librcc

To get this branch, use:
bzr branch http://suren.me/webbzr/rusxmms/librcc

« back to all changes in this revision

Viewing changes to examples/example2.c

  • Committer: Suren A. Chilingaryan
  • Date: 2013-11-14 18:45:49 UTC
  • Revision ID: csa@dside.dyndns.org-20131114184549-usbfnpyotja4lsxk
Fix complaining in example

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
        if (strlen(buf)<2) break;
66
66
        
67
67
        rccstring = rccFrom(NULL, 0, buf);
 
68
        if (!rccstring) rccstring = strdup(buf);
 
69
 
68
70
        if (rccstring) {
69
71
            recoded = rccTo(NULL, 1, rccstring);
 
72
            if (!recoded) recoded = strdup(rccstring);
70
73
            if (recoded) {
71
74
                printf("%s", recoded);
72
75
                free(recoded);
73
 
            } else printf("Recoding from UTF-8 is failed\n");
 
76
            } 
74
77
            free(rccstring);
75
 
        } else printf("Recoding to UTF-8 is failed\n");
 
78
        } 
76
79
    }
77
80
 
78
81
    rccFree();