xref: /illumos-gate/usr/src/test/libc-tests/tests/wcsncasecmp-7350.c (revision f2d34afa1058d195513e7ab9a6c1f0ce38b4d05b)
1*f2d34afaSRobert Mustacchi /*
2*f2d34afaSRobert Mustacchi  * This file and its contents are supplied under the terms of the
3*f2d34afaSRobert Mustacchi  * Common Development and Distribution License ("CDDL"), version 1.0.
4*f2d34afaSRobert Mustacchi  * You may only use this file in accordance with the terms of version
5*f2d34afaSRobert Mustacchi  * 1.0 of the CDDL.
6*f2d34afaSRobert Mustacchi  *
7*f2d34afaSRobert Mustacchi  * A full copy of the text of the CDDL should have accompanied this
8*f2d34afaSRobert Mustacchi  * source.  A copy of the CDDL is also available via the Internet at
9*f2d34afaSRobert Mustacchi  * http://www.illumos.org/license/CDDL.
10*f2d34afaSRobert Mustacchi  */
11*f2d34afaSRobert Mustacchi 
12*f2d34afaSRobert Mustacchi /*
13*f2d34afaSRobert Mustacchi  * Copyright 2016 Joyent, Inc.
14*f2d34afaSRobert Mustacchi  */
15*f2d34afaSRobert Mustacchi 
16*f2d34afaSRobert Mustacchi /*
17*f2d34afaSRobert Mustacchi  * Regression test for illumos#7350. Make sure that wcsncasecmp() doesn't read
18*f2d34afaSRobert Mustacchi  * data from the data buffer when zero characters are specified.
19*f2d34afaSRobert Mustacchi  */
20*f2d34afaSRobert Mustacchi 
21*f2d34afaSRobert Mustacchi #include <wchar.h>
22*f2d34afaSRobert Mustacchi #include <sys/debug.h>
23*f2d34afaSRobert Mustacchi 
24*f2d34afaSRobert Mustacchi int
main(void)25*f2d34afaSRobert Mustacchi main(void)
26*f2d34afaSRobert Mustacchi {
27*f2d34afaSRobert Mustacchi 	wchar_t *a = (void *)(uintptr_t)0x8;
28*f2d34afaSRobert Mustacchi 	wchar_t *b = (void *)(uintptr_t)0x40;
29*f2d34afaSRobert Mustacchi 
30*f2d34afaSRobert Mustacchi 	VERIFY0(wcsncasecmp(a, b, 0));
31*f2d34afaSRobert Mustacchi 	return (0);
32*f2d34afaSRobert Mustacchi }
33