Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Erik Strand
lufa
Commits
b0570416
Commit
b0570416
authored
Nov 09, 2011
by
Dean Camera
Browse files
Use strcat() in the HTTPServer project instead of using strcpy() and strlen().
parent
65644164
Changes
1
Hide whitespace changes
Inline
Side-by-side
Projects/Webserver/Lib/HTTPServerApp.c
View file @
b0570416
...
...
@@ -218,7 +218,7 @@ static void HTTPServerApp_SendResponseHeader(void)
{
/* Copy over the HTTP 404 response header and send it to the receiving client */
strcpy_P
(
AppData
,
HTTP404Header
);
strc
py
(
&
AppData
[
strlen
(
AppData
)]
,
AppState
->
HTTPServer
.
FileName
);
strc
at
(
AppData
,
AppState
->
HTTPServer
.
FileName
);
uip_send
(
AppData
,
strlen
(
AppData
));
AppState
->
HTTPServer
.
NextState
=
WEBSERVER_STATE_Closing
;
...
...
@@ -236,7 +236,7 @@ static void HTTPServerApp_SendResponseHeader(void)
{
if
(
strcmp
(
&
Extension
[
1
],
MIMETypes
[
i
].
Extension
)
==
0
)
{
strc
py
(
&
AppData
[
strlen
(
AppData
)]
,
MIMETypes
[
i
].
MIMEType
);
strc
at
(
AppData
,
MIMETypes
[
i
].
MIMEType
);
FoundMIMEType
=
true
;
break
;
}
...
...
@@ -247,11 +247,11 @@ static void HTTPServerApp_SendResponseHeader(void)
if
(
!
(
FoundMIMEType
))
{
/* MIME type not found - copy over the default MIME type */
strc
py_P
(
&
AppData
[
strlen
(
AppData
)]
,
DefaultMIMEType
);
strc
at_P
(
AppData
,
DefaultMIMEType
);
}
/* Add the end-of-line terminator and end-of-headers terminator after the MIME type */
strc
py_P
(
&
AppData
[
strlen
(
AppData
)]
,
PSTR
(
"
\r\n\r\n
"
));
strc
at_P
(
AppData
,
PSTR
(
"
\r\n\r\n
"
));
/* Send the MIME header to the receiving client */
uip_send
(
AppData
,
strlen
(
AppData
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment