projects
/
fw
/
pdclib
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Proper handling of end-of-string.
[fw/pdclib]
/
functions
/
string
/
strspn.c
diff --git
a/functions/string/strspn.c
b/functions/string/strspn.c
index a5859cc2ca89b7b2d544457370fde2a74b6c550a..a546e94f45ce9cd6c0e74e5b828b3472eb314788 100644
(file)
--- a/
functions/string/strspn.c
+++ b/
functions/string/strspn.c
@@
-1,7
+1,5
@@
/* $Id$ */
/* $Id$ */
-/* Release $Name$ */
-
/* strspn( const char *, const char * )
This file is part of the Public Domain C Library (PDCLib).
/* strspn( const char *, const char * )
This file is part of the Public Domain C Library (PDCLib).
@@
-10,6
+8,8
@@
#include <string.h>
#include <string.h>
+#ifndef REGTEST
+
size_t strspn( const char * s1, const char * s2 )
{
size_t len = 0;
size_t strspn( const char * s1, const char * s2 )
{
size_t len = 0;
@@
-34,12
+34,13
@@
size_t strspn( const char * s1, const char * s2 )
return len;
}
return len;
}
+#endif
+
#ifdef TEST
#include <_PDCLIB_test.h>
#ifdef TEST
#include <_PDCLIB_test.h>
-int main()
+int main(
void
)
{
{
- BEGIN_TESTS;
TESTCASE( strspn( abcde, "abc" ) == 3 );
TESTCASE( strspn( abcde, "b" ) == 0 );
TESTCASE( strspn( abcde, abcde ) == 5 );
TESTCASE( strspn( abcde, "abc" ) == 3 );
TESTCASE( strspn( abcde, "b" ) == 0 );
TESTCASE( strspn( abcde, abcde ) == 5 );