summaryrefslogtreecommitdiffstats
path: root/iconv.c
diff options
context:
space:
mode:
Diffstat (limited to 'iconv.c')
-rw-r--r--iconv.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/iconv.c b/iconv.c
index 533da0a..6fa63a7 100644
--- a/iconv.c
+++ b/iconv.c
@@ -14,7 +14,7 @@
static int decode_ascii(int *scalar, const unsigned char *inbuf, int count);
-static int decode_iso_8859_1(int *scalar, const unsigned char *inbuf,
+static int decode_iso_8859_1(int *scalar, const unsigned char *inbuf,
int count);
static int decode_utf_8(int *scalar, const unsigned char *inbuf, int count);
@@ -36,12 +36,12 @@ struct converter {
};
struct converter supported_codesets[] = {
- {
+ {
.code = ASCII,
.name = "ASCII",
.decode = &decode_ascii,
.encode = &encode_ascii,
- }, {
+ }, {
.code = UTF_8,
.name = "UTF-8",
.decode = &decode_utf_8,
@@ -57,7 +57,7 @@ struct converter supported_codesets[] = {
};
/* ASCII */
-static int decode_ascii(int *scalar, const unsigned char *inbuf,
+static int decode_ascii(int *scalar, const unsigned char *inbuf,
int UNUSED count)
{
if (*inbuf >= 0x80) {
@@ -121,7 +121,7 @@ static int decode_utf_8(int *scalar, const unsigned char *inbuf, int count)
errno = EILSEQ;
return -1;
}
-
+
*scalar = ((i & 0x1700) >> 2) | (i & 0x3f);
return 2;
}
@@ -174,7 +174,7 @@ iconv_t iconv_open(const char *tocode, const char *fromcode)
errno = EINVAL;
goto return_error;
}
-
+
src = find_converter(fromcode);
dest = find_converter(tocode);
if (src == -1 || dest == -1) {
@@ -186,8 +186,8 @@ iconv_t iconv_open(const char *tocode, const char *fromcode)
return_error:
return cd;
-}
-
+}
+
int iconv_close(iconv_t UNUSED cd)
{
return 0;
@@ -206,7 +206,7 @@ size_t iconv(iconv_t cd, const char **inbuf, size_t *insize,
infwd = in->decode(&scalar, (unsigned char *)*inbuf, *insize);
if (infwd < 0)
goto ret_error;
-
+
outfwd = out->encode(scalar, (unsigned char *)*outbuf);
if (outfwd > *outsize) {
errno = E2BIG;
@@ -216,7 +216,7 @@ size_t iconv(iconv_t cd, const char **inbuf, size_t *insize,
if (**inbuf != scalar || outfwd == 0)
nonidentical++;
- *inbuf += infwd;
+ *inbuf += infwd;
*insize -= infwd;
*outbuf += outfwd;
*outsize -= outfwd;