It has been a while since I did some parsing in C, so I am trying to get it all back

I have a specific string that I need to parse. Basically get the specific string of length M starting at position X.

Here is a sample of data format:

Code:
1   TestTeamCisco96279               68:7f:74:56:64:ec   WPA2PSK/AES            68       11b/g/n NONE   In
I have a structure to to store this data.

Right now I have parse until WPAPSK/AES and I wanted to separate the string before and after "/" .

So here is what I did.

Code:
int get_data(char *ssid, char *mac , char *auth, char * enc, const char *data)
{
char p[150];
char tmp[30];
 
 memset(p, 0, strlen(data) );
 memcpy(p, data, strlen(data));

 // get data starting at pos =57 length = 23
 memmove(tmp, p+57, 23);
 
 int pos = strcspn(tmp , "/");
 
  memmove(enc, tmp+pos+1, strlen(tmp)-pos);
  memmove(auth, p+57, pos);
 
 printf("Auth  :: %s \n", auth);
 printf("Encryption :: %s \n", enc);
}
The output is these:

Code:
Auth :: WPA2PSK
Encryption :: AES            WPA2PSK
If I changed the lenght of Encryption to 10, then the data is corrrectly displayed.

This is something wrong with how I manipulated the pointers?

englighten me please