[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #52059] httpd/makefsdata assumes UNICODE
From: |
Simon Goldschmidt |
Subject: |
[lwip-devel] [bug #52059] httpd/makefsdata assumes UNICODE |
Date: |
Tue, 19 Sep 2017 10:04:04 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36 |
URL:
<http://savannah.nongnu.org/bugs/?52059>
Summary: httpd/makefsdata assumes UNICODE
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: goldsimon
Submitted on: Tue 19 Sep 2017 02:04:03 PM UTC
Category: apps
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
lwIP version: git head
_______________________________________________________
Details:
Simple fix (by gisle vanem on lwip-devel):
--- a/src/apps/httpd/makefsdata/makefsdata.c 2017-09-18 19:58:19
+++ b/src/apps/httpd/makefsdata/makefsdata.c 2017-09-18 21:23:35
@@ -421,7 +421,7 @@
ret = tinydir_readfile_n(&dir, &file, i);
if (ret == 0) {
-#if (defined _MSC_VER || defined __MINGW32__)
+#if (defined _MSC_VER || defined __MINGW32__) && (defined _UNICODE)
size_t i;
char currName[256];
wcstombs_s(&i, currName, sizeof(currName), file.name,
sizeof(currName));
@@ -461,12 +461,12 @@
if (ret == 0) {
if (!file.is_dir) {
-#if (defined _MSC_VER || defined __MINGW32__)
+#if (defined _MSC_VER || defined __MINGW32__) && defined _UNICODE
size_t i;
char curName[256];
wcstombs_s(&i, curName, sizeof(curName), file.name,
sizeof(curName));
#else
- const char *currName = file.name;
+ const char *curName = file.name;
#endif
if (strcmp(curName, "fsdata.tmp") == 0) {
----
Note the code's use of 'currName' and 'curName'.
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?52059>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [lwip-devel] [bug #52059] httpd/makefsdata assumes UNICODE,
Simon Goldschmidt <=