Deleted Added
full compact
mbrtocXX_iconv.h (252547) mbrtocXX_iconv.h (281550)
1/*-
2 * Copyright (c) 2013 Ed Schouten <ed@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2013 Ed Schouten <ed@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/lib/libc/locale/mbrtocXX_iconv.h 252547 2013-07-03 07:03:19Z peter $");
28__FBSDID("$FreeBSD: head/lib/libc/locale/mbrtocXX_iconv.h 281550 2015-04-15 09:09:20Z tijl $");
29
30#include <sys/queue.h>
31
32#include <assert.h>
33#include <errno.h>
34#include <langinfo.h>
35#include <limits.h>
36#include <string.h>

--- 57 unchanged lines hidden (view full) ---

94
95 /* Fill up the read buffer as far as possible. */
96 if (n > sizeof(cs->srcbuf) - cs->srcbuf_len)
97 n = sizeof(cs->srcbuf) - cs->srcbuf_len;
98 memcpy(cs->srcbuf + cs->srcbuf_len, s, n);
99
100 /* Convert as few characters to the dst buffer as possible. */
101 for (i = 0; ; i++) {
29
30#include <sys/queue.h>
31
32#include <assert.h>
33#include <errno.h>
34#include <langinfo.h>
35#include <limits.h>
36#include <string.h>

--- 57 unchanged lines hidden (view full) ---

94
95 /* Fill up the read buffer as far as possible. */
96 if (n > sizeof(cs->srcbuf) - cs->srcbuf_len)
97 n = sizeof(cs->srcbuf) - cs->srcbuf_len;
98 memcpy(cs->srcbuf + cs->srcbuf_len, s, n);
99
100 /* Convert as few characters to the dst buffer as possible. */
101 for (i = 0; ; i++) {
102 const char *src;
103 char *dst;
102 char *src, *dst;
104 size_t srcleft, dstleft, invlen;
105 int err;
106
107 src = cs->srcbuf;
108 srcleft = cs->srcbuf_len + n;
109 dst = cs->dstbuf.bytes;
110 dstleft = i * sizeof(charXX_t);
111 assert(srcleft <= sizeof(cs->srcbuf) &&

--- 48 unchanged lines hidden ---
103 size_t srcleft, dstleft, invlen;
104 int err;
105
106 src = cs->srcbuf;
107 srcleft = cs->srcbuf_len + n;
108 dst = cs->dstbuf.bytes;
109 dstleft = i * sizeof(charXX_t);
110 assert(srcleft <= sizeof(cs->srcbuf) &&

--- 48 unchanged lines hidden ---