forked from KolibriOS/kolibrios
bugfixing
git-svn-id: svn://kolibrios.org@6412 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#include <string.h>
|
||||
|
||||
int strcoll(const char* string1,const char* string2)
|
||||
{
|
||||
return strcmp(string1,string2);
|
||||
|
@@ -1,4 +1,7 @@
|
||||
char* strdup(char* str)
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
char* strdup(const char* str)
|
||||
{
|
||||
char* res;
|
||||
int len;
|
||||
|
@@ -1,13 +1,13 @@
|
||||
char* strpbrk(const char* string, const char* strCharSet)
|
||||
{
|
||||
char* temp;
|
||||
const char* temp;
|
||||
while (*string!='\0')
|
||||
{
|
||||
temp=strCharSet;
|
||||
while (*temp!='\0')
|
||||
{
|
||||
if (*string==*temp)
|
||||
return string;
|
||||
return (char*)string;
|
||||
temp++;
|
||||
}
|
||||
string++;
|
||||
|
12
programs/develop/ktcc/trunk/libc/string/strrev.c
Normal file
12
programs/develop/ktcc/trunk/libc/string/strrev.c
Normal file
@@ -0,0 +1,12 @@
|
||||
char* strrev(char *p)
|
||||
{
|
||||
char *q = p, *res = p, z;
|
||||
while(q && *q) ++q; /* find eos */
|
||||
for(--q; p < q; ++p, --q)
|
||||
{
|
||||
z = *p;
|
||||
*p = *q;
|
||||
*q = z;
|
||||
}
|
||||
return res;
|
||||
}
|
@@ -1,11 +1,12 @@
|
||||
extern int strncmp(char* s1,char* s2,int len);
|
||||
#include<string.h>
|
||||
|
||||
char* strstr(const char* s, const char* find)
|
||||
{
|
||||
int len;
|
||||
len=strlen(find);
|
||||
while (1)
|
||||
{
|
||||
if (strncmp(s,find,len)==0) return s;
|
||||
if (strncmp(s,find,len)==0) return (char*)s;
|
||||
if (*s=='\0')
|
||||
return (char*) 0;
|
||||
s++;
|
||||
|
Reference in New Issue
Block a user