mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
Avoid infinite loop (and quiet gcc warning)
This commit is contained in:
parent
803655dba9
commit
ec246e2a51
12
darkhttpd.c
12
darkhttpd.c
@ -832,12 +832,12 @@ static const char *uri_content_type(const char *uri)
|
||||
{
|
||||
size_t period, urilen = strlen(uri);
|
||||
|
||||
for (period=urilen-1;
|
||||
period > 0 &&
|
||||
uri[period] != '.' &&
|
||||
(urilen-period-1) <= longest_ext;
|
||||
period--)
|
||||
;
|
||||
period=urilen;
|
||||
while ((period > 0) &&
|
||||
(uri[period] != '.') &&
|
||||
((urilen-period-1) <= longest_ext)) {
|
||||
period--;
|
||||
}
|
||||
|
||||
if (uri[period] == '.')
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user