lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] makefsdata.c assumes UNICODE


From: Gisle Vanem
Subject: [lwip-devel] makefsdata.c assumes UNICODE
Date: Mon, 18 Sep 2017 23:31:07 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

This command
htmlgen.exe -f:fstmp.c -nossi ./win-web/

generates this junk:
...
Writing to file "fstmp.c"
HTTP 1.0 header will be statically included.
  Processing all files in directory ./win-web and subdirectories...

processing subdirectory //...
processing subdirectory ///...
processing subdirectory ////...
processing subdirectory /////...
...

WARNING: cannot process sub due to path length restrictions: 
"//////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////"

Because the use of 'wcstombs_s()'. I.e. it ass-u-me UNICODE is in effect.
Why?

Simple fix:

--- 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'.


--
--gv



reply via email to

[Prev in Thread] Current Thread [Next in Thread]