mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
chomp() isn't needed because read_line() strips [cr]lf.
This commit is contained in:
parent
6e1f045393
commit
4c8b1e22f3
10
darkhttpd.c
10
darkhttpd.c
@ -747,15 +747,6 @@ static char *read_line(FILE *fp) {
|
||||
return buf;
|
||||
}
|
||||
|
||||
/* Removes the ending newline in a string, if there is one. */
|
||||
static void chomp(char *str) {
|
||||
size_t len = strlen(str);
|
||||
if (len == 0)
|
||||
return;
|
||||
if (str[len - 1] == '\n')
|
||||
str[len - 1] = '\0';
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------------
|
||||
* Adds contents of specified file to mime_map list.
|
||||
*/
|
||||
@ -766,7 +757,6 @@ static void parse_extension_map_file(const char *filename) {
|
||||
if (fp == NULL)
|
||||
err(1, "fopen(\"%s\")", filename);
|
||||
while ((buf = read_line(fp)) != NULL) {
|
||||
chomp(buf);
|
||||
parse_mimetype_line(buf);
|
||||
free(buf);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user