Apache Module - string question
Hi guys,
i've been trying too modify an apache module to write some stuff to a text file - and i'm struggling to get the last character off the url (trying to match against "/" or print to a file)
i've tried the methods from here - http://cboard.cprogramming.com/c-pro...er-string.html
But I think i'm missing something... this is the code i've got
Code:
char mystr[50];
mystr = "this is a string//"; //r->uri;
end_char = mystr[(strlen(mystr)-1)];
if(strrchr(mystr,"/") == (strlen(mystr) - 1)) {
fprintf(files, "end char: %s\n", "slash");
} else {
fprintf(files, "end char: %s\n", "no slash");
}
fprintf(files, "efef: %s\n", end_char );
fprintf(files, "str length: %u - %u\n", strlen(mystr),strrchr(mystr,"/"));
many different methods - trying to get the last character.
Can anyone shed any light on what i'm doing wrong.
EDIT: The writing to files works - and this is just a snippet
Thanks
Mark Willis