Parsing a CSV string

I have very little experience with strings in the Arduino context. The following piece of code works exactly as I want it to but I wonder if it is the usual way that Arduino folk would tackle this task.

Basically the code takes the string in the char array inputSeveral[] and puts the 3 items into separate variables.

 char inputSeveral[] = "qwert, 23, 89.87"; // a string, an int, and a float

int inputInt = 0;
float inputFloat = 0.0;
char inputCsvString[12];

char * partOfString; // this is used by strtok_r() as an index

partOfString = strtok (inputSeveral,","); // get the first part - the string
strcpy(inputCsvString, partOfString);     // copy it to inputCsvString

partOfString = strtok (NULL, ","); // this continues where the previous call left off
inputInt = atoi(partOfString);     // convert this part to an integer

partOfString = strtok (NULL, ","); // this continues where the previous call left off
inputFloat = atof(partOfString);   // convert this part to a float

...R

this looks like a good use of strtok (which is quite efficient in time and space)

robtillaart:
this looks like a good use of strtok (which is quite efficient in time and space)

But it makes assumptions about the format of the data that may not be valid. For instance, strtok() may not return a pointer. Before dereferencing the pointer returned by strtok(), one should test that strtok() returned a pointer.