Return to strtok_r.c CVS log | Up to [DVB] / dietlibc / lib |
fixing strtok_r (rewrite) making the %m support NON DEFAULT as it is NOT SUSv3 or SUSv2 started to fix scanf
#include <string.h> char*strtok_r(char*s,const char*delim,char**ptrptr) { char*tmp=0; if (s==0) s=*ptrptr; s+=strspn(s,delim); /* overread leading delimiter */ if (__likely(*s)) { tmp=s; s+=strcspn(s,delim); if (__likely(*s)) *s++=0; /* not the end ? => terminate it */ } *ptrptr=s; return tmp; }