@@ -71,23 +71,23 @@ void renderTable(asciiParams params){
7171 i = (i /2 );
7272 }
7373
74- snwprintf (tmp , sizeof (tmp ), L"%s " , binStr );
74+ snwprintf (tmp , sizeof (tmp ), L"%ls " , binStr );
7575 wcscat (lines [currRow ],tmp );
7676 }
7777
7878 if (isPrintable (params .content [s ])){
79- snwprintf (tmp , sizeof (tmp ),s % 2 == 0 ? L"" YEL "%c " RESET : L"" GOLD "%c " RESET , params .content [s ]);
79+ snwprintf (tmp , sizeof (tmp ),L"" YEL "%c " RESET , params .content [s ]);
8080 currLineLength = 0 ;
8181 }else {
8282 wchar_t * print = getPrintable (params .content [s ]);
8383 currLineLength = wcslen (print ) - 3 ;
84- snwprintf (tmp , sizeof (tmp ),s % 2 == 0 ? L"" YEL "%s" RESET : L"" GOLD "%s "RESET , print );
84+ snwprintf (tmp , sizeof (tmp ),L"" YEL "%ls " RESET , print );
8585 }
8686 if (params .onlyChar || params ._onlyAll ) wcscat (lines [currRow ],tmp );
8787
8888 if (currCol != col ){
8989 wchar_t * spaces = (wchar_t * )calloc ( (size_t )maxLength [currCol - 1 ] - currLineLength + 1 ,sizeof (wchar_t ));
90- memset (spaces , (wchar_t )32 , sizeof ( wchar_t ) * (size_t )maxLength [currCol - 1 ] - currLineLength );
90+ wmemset (spaces , (wchar_t )32 , (size_t )maxLength [currCol - 1 ] - currLineLength );
9191
9292 wcscat (lines [currRow ],spaces );
9393 wcscat (lines [currRow ],currLineLength == 0 ?L" | " :L" | " );
@@ -128,7 +128,7 @@ void renderTable(asciiParams params){
128128 }wprintf (L"\n" RESET );
129129
130130 for (uint8_t i = 0 ; i < row ; i ++ ){
131- wprintf (L"%s \n" RESET ,lines [i ]);
131+ wprintf (L"%ls \n" RESET ,lines [i ]);
132132 }wprintf (L"" RESET );
133133
134134 for (uint8_t i = 0 ; i < col ; i ++ ){
@@ -153,17 +153,12 @@ int main(int argv, char** _args){
153153 size_t wide_len = strlen (_args [i ]) + 1 ;
154154 args [i ] = (wchar_t * )calloc ( wide_len , sizeof (wchar_t ));
155155
156- for (uint8_t j = 0 ; j < wide_len ; j ++ ){
157- args [i ][j ] = (wchar_t )_args [i ][j ];
158- wprintf (L"[%c " ,args [i ][j ]);
159- wprintf (L"%s] " ,args [i ]);
160- }
161-
162- wprintf (L" content:%s;%d\nwcontent:%s;%d\n\n" ,_args [i ],wide_len ,args [i ],wcslen (args [i ]));
156+ for (uint8_t j = 0 ; j < wide_len ; j ++ )
157+ args [i ][j ] = (wchar_t )_args [i ][j ];
163158 }
164159
165160 asciiParams params = parseParameter (argv , args );
166-
161+
167162 if (params .color ){
168163 system ("REG ADD HKCU\\CONSOLE /f /v VirtualTerminalLevel /t REG_DWORD /d 1" );
169164 return 0 ;
@@ -183,17 +178,17 @@ int main(int argv, char** _args){
183178 free (cpy );
184179
185180 if (params .showAllAlphas || params .showAll ){
186- wcscpy (params .content ,L"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" );
181+ wcscat (params .content ,L"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" );
187182 params .contentSize += params .showAllAlphas ;
188183 }
189184
190185 if (params .showAllDigits || params .showAll ){
191- wcscpy (params .content ,L"0123456789" );
186+ wcscat (params .content ,L"0123456789" );
192187 params .contentSize += params .showAllDigits ;
193188 }
194189
195190 if (params .showSpecialChars || params .showAll ){
196- wcscpy (params .content ,L" !\"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~" );
191+ wcscat (params .content ,L" !\"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~" );
197192 params .contentSize += params .showSpecialChars ;
198193 }
199194
@@ -213,7 +208,7 @@ int main(int argv, char** _args){
213208
214209 removeDuplicateChars (& params );
215210 sortChars (& params );
216-
211+
217212 HMODULE hDLL = LoadLibrary ("renderer.dll" );
218213 if (hDLL == NULL ){
219214 renderTable (params );
@@ -225,7 +220,7 @@ int main(int argv, char** _args){
225220 renderTable (params );
226221 return EXIT_SUCCESS ;
227222 }
228-
223+
229224 renderTable (params );
230225 // __renderTable(params);
231226
0 commit comments