Basically I am having problems swapping two strings (char arrays).

prototypes for the functions in question:
Code:
int main(int argc, char *argv[]);
void ssort(char *argv[], int len);
void swap(char ** s, char ** p);
How I call ssort from main:
Code:
ssort(argv,argc);

This is the function ssort:
Code:
void ssort(char *argv[], int len) {
while(len > 2){
if(strcmp(argv[len-2],argv[len-1]))
swap( &argv[len-2], &argv[len-1]); /*IS THIS WRONG!?*/
len--;
}
}
And here is swap:
Code:
void swap(char ** s, char ** p) {
char temp[strlen(*s)-1];
strcpy(temp,*s);
strcpy(*s,*p);
strcpy(*p,temp);
}

I'm pretty sure my swap function is the thing that's wrong. The program compiles fine but it is not swapping the strings like I want.

I have a function that prints out the strings, and it prints out exactly what I type in the first time, but then after it has gone through the sorting process, it gives them back in a different order but some have been combined with others and only half of the word is there.

This is an assignment and I have to change the actual string itself, not just print out the string in the correct order