projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix incorrect macro guard in the UC3 EndpointStream header file.
[pub/USBasp.git]
/
Projects
/
Webserver
/
Lib
/
HTTPServerApp.c
diff --git
a/Projects/Webserver/Lib/HTTPServerApp.c
b/Projects/Webserver/Lib/HTTPServerApp.c
index
3ab3003
..
6822b27
100644
(file)
--- a/
Projects/Webserver/Lib/HTTPServerApp.c
+++ b/
Projects/Webserver/Lib/HTTPServerApp.c
@@
-1,13
+1,13
@@
/*
LUFA Library
/*
LUFA Library
- Copyright (C) Dean Camera, 201
0
.
+ Copyright (C) Dean Camera, 201
1
.
dean [at] fourwalledcubicle [dot] com
dean [at] fourwalledcubicle [dot] com
- www.fourwalledcubicle.com
+ www.lufa-lib.org
*/
/*
*/
/*
- Copyright 201
0
Dean Camera (dean [at] fourwalledcubicle [dot] com)
+ Copyright 201
1
Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@
-181,7
+181,7
@@
static void HTTPServerApp_OpenRequestedFile(void)
}
/* Copy over the requested filename */
}
/* Copy over the requested filename */
- strncpy(AppState->HTTPServer.FileName, &RequestedFileName[1],
(sizeof(AppState->HTTPServer.FileName) - 1
));
+ strncpy(AppState->HTTPServer.FileName, &RequestedFileName[1],
sizeof(AppState->HTTPServer.FileName
));
/* Ensure filename is null-terminated */
AppState->HTTPServer.FileName[sizeof(AppState->HTTPServer.FileName) - 1] = 0x00;
/* Ensure filename is null-terminated */
AppState->HTTPServer.FileName[sizeof(AppState->HTTPServer.FileName) - 1] = 0x00;
@@
-190,11
+190,11
@@
static void HTTPServerApp_OpenRequestedFile(void)
uint8_t FileNameLen = strlen(AppState->HTTPServer.FileName);
/* If the URI is a directory, append the default filename */
uint8_t FileNameLen = strlen(AppState->HTTPServer.FileName);
/* If the URI is a directory, append the default filename */
- if (
AppState->HTTPServer.FileName[FileNameLen - 1] == '/'
)
+ if (
(AppState->HTTPServer.FileName[FileNameLen - 1] == '/') || !(FileNameLen)
)
{
strncpy_P(&AppState->HTTPServer.FileName[FileNameLen], DefaultDirFileName,
(sizeof(AppState->HTTPServer.FileName) - FileNameLen));
{
strncpy_P(&AppState->HTTPServer.FileName[FileNameLen], DefaultDirFileName,
(sizeof(AppState->HTTPServer.FileName) - FileNameLen));
-
+
/* Ensure altered filename is still null-terminated */
AppState->HTTPServer.FileName[sizeof(AppState->HTTPServer.FileName) - 1] = 0x00;
}
/* Ensure altered filename is still null-terminated */
AppState->HTTPServer.FileName[sizeof(AppState->HTTPServer.FileName) - 1] = 0x00;
}