wcstombs.c (102762) | wcstombs.c (103012) |
---|---|
1/*- 2 * Copyright (c) 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Paul Borman at Krystal Technologies. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 21 unchanged lines hidden (view full) --- 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 */ 36 37#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Paul Borman at Krystal Technologies. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 21 unchanged lines hidden (view full) --- 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 */ 36 37#include <sys/cdefs.h> |
38__FBSDID("$FreeBSD: head/lib/libc/locale/wcstombs.c 102762 2002-09-01 07:08:22Z tjr $"); | 38__FBSDID("$FreeBSD: head/lib/libc/locale/wcstombs.c 103012 2002-09-06 11:24:06Z tjr $"); |
39 40#include <errno.h> 41#include <stdlib.h> 42#include <limits.h> 43#include <stddef.h> 44#include <rune.h> 45 46size_t 47wcstombs(s, pwcs, n) | 39 40#include <errno.h> 41#include <stdlib.h> 42#include <limits.h> 43#include <stddef.h> 44#include <rune.h> 45 46size_t 47wcstombs(s, pwcs, n) |
48 char *__restrict s; 49 const wchar_t *__restrict pwcs; | 48 char * __restrict s; 49 const wchar_t * __restrict pwcs; |
50 size_t n; 51{ 52 char buf[MB_LEN_MAX]; 53 char *e; 54 int cnt, nb; 55 56 if (!pwcs || n > INT_MAX) { 57 errno = EINVAL; --- 37 unchanged lines hidden --- | 50 size_t n; 51{ 52 char buf[MB_LEN_MAX]; 53 char *e; 54 int cnt, nb; 55 56 if (!pwcs || n > INT_MAX) { 57 errno = EINVAL; --- 37 unchanged lines hidden --- |