mirror of
git://sourceware.org/git/glibc.git
synced 2024-12-15 04:20:28 +08:00
30891f35fa
We stopped adding "Contributed by" or similar lines in sources in 2012 in favour of git logs and keeping the Contributors section of the glibc manual up to date. Removing these lines makes the license header a bit more consistent across files and also removes the possibility of error in attribution when license blocks or files are copied across since the contributed-by lines don't actually reflect reality in those cases. Move all "Contributed by" and similar lines (Written by, Test by, etc.) into a new file CONTRIBUTED-BY to retain record of these contributions. These contributors are also mentioned in manual/contrib.texi, so we just maintain this additional record as a courtesy to the earlier developers. The following scripts were used to filter a list of files to edit in place and to clean up the CONTRIBUTED-BY file respectively. These were not added to the glibc sources because they're not expected to be of any use in future given that this is a one time task: https://gist.github.com/siddhesh/b5ecac94eabfd72ed2916d6d8157e7dc https://gist.github.com/siddhesh/15ea1f5e435ace9774f485030695ee02 Reviewed-by: Carlos O'Donell <carlos@redhat.com>
58 lines
1.1 KiB
C
58 lines
1.1 KiB
C
|
|
#include <iconv.h>
|
|
#include <errno.h>
|
|
#include <stddef.h>
|
|
#include <stdio.h>
|
|
|
|
#define BUFSIZE 10000
|
|
|
|
static int
|
|
do_test (void)
|
|
{
|
|
char inbuf[BUFSIZE];
|
|
wchar_t outbuf[BUFSIZE];
|
|
|
|
iconv_t cd;
|
|
int i;
|
|
char *inptr;
|
|
char *outptr;
|
|
size_t inbytes_left, outbytes_left;
|
|
int count;
|
|
int result = 0;
|
|
|
|
for (i=0; i < BUFSIZE; i++)
|
|
inbuf[i] = 'a';
|
|
|
|
cd = iconv_open ("UCS-4LE", "UTF-8");
|
|
|
|
inbytes_left = BUFSIZE;
|
|
outbytes_left = BUFSIZE * 4;
|
|
inptr = inbuf;
|
|
outptr = (char *) outbuf;
|
|
|
|
count = iconv (cd, &inptr, &inbytes_left, &outptr, &outbytes_left);
|
|
|
|
if (count < 0)
|
|
{
|
|
if (errno == E2BIG)
|
|
printf ("Received E2BIG\n");
|
|
else
|
|
printf ("Received something else\n");
|
|
|
|
printf ("inptr change: %td\n", inptr - inbuf);
|
|
printf ("inlen change: %zd\n", BUFSIZE - inbytes_left);
|
|
printf ("outptr change: %td\n", outptr - (char *) outbuf);
|
|
printf ("outlen change: %zd\n", BUFSIZE * 4 - outbytes_left);
|
|
result = 1;
|
|
}
|
|
else
|
|
printf ("Succeeded\n");
|
|
|
|
iconv_close (cd);
|
|
|
|
return result;
|
|
}
|
|
|
|
#define TEST_FUNCTION do_test ()
|
|
#include "../test-skeleton.c"
|