Description
Consider the following:
dtrace -n BEGIN'{ x = "a|b|c|"; trace(x); trace(strtok(x, "|")); trace(strtok(NULL, "|")); trace(strtok(NULL, "|")); trace(strtok(NULL, "|")); exit(0); }'
dtrace: description 'BEGIN' matched 1 probe
dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): invalid address (0x0) in action #1
vs
dtrace -n BEGIN'{ x = "a|b|c|"; trace(x); trace(strtok(x, "|")); trace(strtok(NULL, "|")); trace(strtok(NULL, "|")); s = strtok(NULL, "|"); trace(s); exit(0); }'
dtrace: description 'BEGIN' matched 1 probe
CPU ID FUNCTION:NAME
9 1 :BEGIN a|b|c| a b c
In the second case, s is output as the empty string while the first example would indicate that the result of the strtok is NULL.