Salut Bruno, J'espère que tu as passé un bon week-end!
Please find attached my suggestion for mr_strtok() which features the following improvements over strtok(): - thread-safety - input string remains unchanged - concise code It uses strspn() and strcspn() (which do not have any warnings in their manpages) and also malloc() - after all this is still C! ;-) It looks ok to me, no compiler warnings with '-Wall', but there are valgrind errors (see mr_strtok_demo.valgrind in attached tar ball) for both strspn() and strcspn() which may or may not be genuine but at any rate should be about bespoke functions rather than my use of them. (I may be wrong though.) It would be super cool if you could take the sample code for a spin and let me know what you think! Or, to talk in (hopefully correct French) acronyms, QTP*? À la revoyure! Andree * Quesque tu pense? -- Andree Leidenfrost Sydney - Australia
mr_strtok.tar.gz
Description: application/compressed-tar
signature.asc
Description: This is a digitally signed message part