summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuo Jinghua <sunmoon1997@gmail.com>2010-01-08 09:17:57 +0800
committerLuo Jinghua <sunmoon1997@gmail.com>2010-01-08 09:17:57 +0800
commitc3ceab0a38283f77f75f0e7ebda80fc097282858 (patch)
tree3f7c41823bdeb6c1f78346ac9392a360f49ff91d
parent38073de086b87c0589728b66cd12d2184c98a2e4 (diff)
uniconv: change argments of uniconv_open to match iconv_open
-rw-r--r--uconv.c2
-rw-r--r--uniconv.c4
-rw-r--r--uniconv.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/uconv.c b/uconv.c
index 57f28e1..a21829a 100644
--- a/uconv.c
+++ b/uconv.c
@@ -20,7 +20,7 @@ int main(int argc, char **argv)
from = argv[1];
to = argv[2];
- conv = uniconv_open(from, to);
+ conv = uniconv_open(to, from);
if (!conv) {
fprintf (stderr,
"Converting from %s to %s is unsupported.\n",
diff --git a/uniconv.c b/uniconv.c
index 8b3ad04..22a70ee 100644
--- a/uniconv.c
+++ b/uniconv.c
@@ -42,7 +42,7 @@ uniconv_canonical_charset(const char *charset,
}
uniconv_t*
-uniconv_open(const char *from, const char *to)
+uniconv_open(const char *to, const char *from)
{
char frombuf[64];
char tobuf[64];
@@ -112,7 +112,7 @@ uniconv_conv(uniconv_t *uc,
/* converting/pushing input data */
if (inbuf) {
- if (inleft < UNICONV_MAX_LOCAL)
+ if (*inleft < UNICONV_MAX_LOCAL)
ucs4 = local_ucs4;
else
ucs4 = malloc(sizeof(uc_char_t) * (*inleft));
diff --git a/uniconv.h b/uniconv.h
index 714882c..3aaed41 100644
--- a/uniconv.h
+++ b/uniconv.h
@@ -28,7 +28,7 @@ extern "C" {
* @return a conversion descriptor, %NULL in case of error.
*/
uniconv_t*
- uniconv_open(const char *from, const char *to);
+ uniconv_open(const char *to, const char *from);
/**
* peform charset converting