SD read and store

    sub = strtok_r(act, delim, &ptr);

Why are you using the thread-safe version of strtok() on a single-threaded processor?

What is it you expect split() to do? As I read it, it returns the last token in a string.

  for (i = 1, act = copy; i <= index; i++, act = NULL)

Assigning a pointer to point to the start of an array is silly. The strtok() function expects an array of characters that is NULL terminated.

The strtok() function is much simpler, having only two arguments.