cleaner strip_trailing_slash

This commit is contained in:
aabacchus 2021-11-04 18:09:15 +00:00
parent 99f4310188
commit fa99a06619
Signed by: phoebos
GPG Key ID: B02F7D053AC351D3
1 changed files with 3 additions and 3 deletions

6
main.c
View File

@ -308,9 +308,9 @@ cgi(const char *cgicmd)
void
strip_trailing_slash(char *path)
{
size_t len = strlen(path);
while (path[len - 1] == '/')
path[len-- - 1] = '\0';
size_t end = strlen(path) - 1;
while (path[end] == '/')
path[end--] = '\0';
}
int