home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
lxapi32.zip
/
Lib32
/
lxstr.c
< prev
next >
Wrap
C/C++ Source or Header
|
2002-04-26
|
896b
|
51 lines
/* $Id: lxstr.c,v 1.2 2002/04/26 23:09:25 smilcke Exp $ */
/*
* str.c
* Autor: Stefan Milcke
* Erstellt am: 08.11.2001
* Letzte Aenderung am: 31.12.2001
*
*/
#include <string.h>
#include <linux/types.h>
char *strncpy (char *string1, const char *string2, size_t count)
{
char *dst;
dst = string1;
while (count > 0 && *string2 != 0)
{
*dst++ = *string2++;
--count;
}
while (count > 0)
{
*dst++ = 0;
--count;
}
return string1;
}
#ifndef KEE
int dstrncmp(const char *string1,const char *string2,size_t count)
{
char *s1;
char *s2;
s1=(char *)string1;
s2=(char *)string2;
while(count>0 && *s1!=0 && s2!=0)
{
if(*s1!=*s2)
return (*s1)>(*s2) ? 1 : -1;
s1++;
s2++;
count--;
}
if(0==count || (0==*s1 && 0==*s2))
return 0;
return *s1 ? 1 : -1;
}
#endif