A
Aaron Walker
I am attempting to write a http server, and the requested url is always
a string like "/filename.html" for example. I need to strip off the '/'
char before I can attempt to open that file, obviously.
Right now, I have the following code:
/* url is previously declared (of type char *) */
int i, c;
char *url_p;
url_p = (char *) malloc(strlen(url));
for(i = 1, c = 0; i <= strlen(url); i++, c++)
url_p[c] = url;
is this the best way to do this or is there a more efficient way?
Thanks,
Aaron
a string like "/filename.html" for example. I need to strip off the '/'
char before I can attempt to open that file, obviously.
Right now, I have the following code:
/* url is previously declared (of type char *) */
int i, c;
char *url_p;
url_p = (char *) malloc(strlen(url));
for(i = 1, c = 0; i <= strlen(url); i++, c++)
url_p[c] = url;
is this the best way to do this or is there a more efficient way?
Thanks,
Aaron