strncmp.c
377 Bytes
#include <PR/os.h>
#include "common.h"
/*
* Extra stdlib function not supplied by libultra
*/
int strncmp(const char *s,const char *t,int n)
{
int i;
for(i=0; (*s==*t) && (i<n); s++, t++, i++){
if(*s=='\0' && *t=='\0')
return 0;
if(*s=='\0' || *t=='\0')
break;
}
if(i==n)
return 0;
return *s - *t;
}