summaryrefslogtreecommitdiff
path: root/iconvdata/jis0212.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-07-31 17:46:17 +0000
committerJakub Jelinek <jakub@redhat.com>2007-07-31 17:46:17 +0000
commit8833066b122427710a9e14a888ce6cfa862332d3 (patch)
tree29591019d695919417b3698618d6a342e97381d6 /iconvdata/jis0212.h
parentfedca46896bdb702cb988837a0c2c5447e72ba2b (diff)
Updated to fedora-glibc-20070731T1624cvs/fedora-glibc-2_6_90-1
Diffstat (limited to 'iconvdata/jis0212.h')
-rw-r--r--iconvdata/jis0212.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/iconvdata/jis0212.h b/iconvdata/jis0212.h
index ba439e53eb..1f61c258a7 100644
--- a/iconvdata/jis0212.h
+++ b/iconvdata/jis0212.h
@@ -1,5 +1,5 @@
/* Access functions for JISX0212 conversion.
- Copyright (C) 1997, 1998, 1999, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2003, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,6 +21,7 @@
#ifndef _JIS0212_H
#define _JIS0212_H 1
+#include <assert.h>
#include <gconv.h>
#include <stdint.h>
@@ -79,7 +80,7 @@ jisx0212_to_ucs4 (const unsigned char **s, size_t avail, unsigned char offset)
static inline size_t
__attribute ((always_inline))
-ucs4_to_jisx0212 (uint32_t wch, char *s, size_t avail)
+ucs4_to_jisx0212 (uint32_t wch, unsigned char *s, size_t avail)
{
const struct jisx0212_idx *rp = __jisx0212_from_ucs_idx;
unsigned int ch = (unsigned int) wch;
@@ -98,14 +99,11 @@ ucs4_to_jisx0212 (uint32_t wch, char *s, size_t avail)
return __UNKNOWN_10646_CHAR;
s[0] = cp[0];
- if (cp[1] != '\0')
- {
- if (avail < 2)
- return 0;
-
- s[1] = cp[1];
- }
+ assert (cp[1] != '\0');
+ if (avail < 2)
+ return 0;
+ s[1] = cp[1];
return 2;
}