mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-11 07:40:05 +00:00
9c3b1ceba8
* string/bits/string2.h (strspn): Evaluate first argument if second is "". (strpbrk): Likewise. * sysdeps/i386/i486/bits/string.h: Likewise. * string/Makefile (tests): Add bug-strspn1 and bug-strpbrk1. * string/bug-strspn1.c: New file. * string/bug-strpbrk1.c: New file. Test cases by Joseph S. Myers <jsm28@cam.ac.uk>. * string/bits/string2.h (strncat): Terminate string correctly. * sysdeps/i386/i486/bits/string.h (strncat): Likewise. * string/Makefile (tests): Add bug-strncat1. * string/bug-strncat1.c: New file. Test case by Joseph S. Myers <jsm28@cam.ac.uk>. 2000-10-27 Ben Collins <bcollins@debian.org> * sysdeps/generic/lockf.c (lockf): Set l_type to F_RDLCK before calling for F_GETLK. 2000-10-29 Ulrich Drepper <drepper@redhat.com>
31 lines
460 B
C
31 lines
460 B
C
/* Test case by Joseph S. Myers <jsm28@cam.ac.uk>. */
|
|
#define __USE_STRING_INLINES
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
char d[3] = "\0\1\2";
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
strncat (d, "\5\6", 1);
|
|
if (d[0] != '\5')
|
|
{
|
|
puts ("d[0] != '\\5'");
|
|
exit (1);
|
|
}
|
|
if (d[1] != '\0')
|
|
{
|
|
puts ("d[1] != '\\0'");
|
|
exit (1);
|
|
}
|
|
if (d[2] != '\2')
|
|
{
|
|
puts ("d[2] != '\\3'");
|
|
exit (1);
|
|
}
|
|
|
|
exit (0);
|
|
}
|