One of the many forms I have tried is
char *text, ebuf[32];
int *num;
strncpy (ebuf,tfp->d_name,strlen(tfp->d_name));
sscanf (ebuf, "%s_%i.txt", text, num);
I started originally with tfp->d_name in place of the ebuf hack, with the same results: segment faults. I understood from the man page that perhaps the %s should be %4c (text string has 4 characters - but not always). Anyway %4c or 4%c didn't make any difference.
Thanks to all who responded. Your clarifications - especially WhozCraig's "better man page" - put me on the right track.
The initialization issue was not my major problem, it was the syntax of the sscanf. For my program, once initialization was out of the way, the single line I really needed was:
sscanf (tfp->d_name, "%[^_]_%i", &text[0], &num);