Fix misuse of strncasecmp

* src/http.c (set_content_type): Use c_strcasecmp instead of strncasecmp

See issue bug #51576
This commit is contained in:
Tim Rühsen 2017-07-28 16:56:27 +02:00
parent f42229b1fd
commit 5fb6b6bd68

View File

@ -2552,14 +2552,14 @@ set_content_type (int *dt, const char *type)
of the multitude of broken CGI's that "forget" to generate the
content-type. */
if (!type ||
0 == strncasecmp (type, TEXTHTML_S, strlen (TEXTHTML_S)) ||
0 == strncasecmp (type, TEXTXHTML_S, strlen (TEXTXHTML_S)))
0 == c_strcasecmp (type, TEXTHTML_S) ||
0 == c_strcasecmp (type, TEXTXHTML_S))
*dt |= TEXTHTML;
else
*dt &= ~TEXTHTML;
if (type &&
0 == strncasecmp (type, TEXTCSS_S, strlen (TEXTCSS_S)))
0 == c_strcasecmp (type, TEXTCSS_S))
*dt |= TEXTCSS;
else
*dt &= ~TEXTCSS;