@@ -5,7 +5,7 @@ int ft_wctomb(char *s, wchar_t wchar)
5
5
char * tmp ;
6
6
7
7
tmp = s ;
8
- if (wchar <= 0x00FF )
8
+ if (wchar <= 0x007F )
9
9
{
10
10
* tmp = wchar ;
11
11
return (1 );
@@ -348,11 +348,6 @@ t_print *fmt_ptr(t_print *p)
348
348
char * hexn ;
349
349
char * alt ;
350
350
hexn = cast_uint (p , 0 , 16 );
351
- // if (!*hexn && p->precision == 0 && p->width < 1)
352
- // {
353
- // ft_strwjoin(p, " ", 1);
354
- // return (p);
355
- // }
356
351
alt = ft_strdup ("0x" );
357
352
ft_strnjoin (& alt , hexn , ft_strlen (hexn ));
358
353
justify_hex (p , alt , 0 );
@@ -594,7 +589,6 @@ void justify_dec(t_print *p, char *digits)
594
589
595
590
uintmax_t castify (intmax_t n , t_print * p )
596
591
{
597
- // char lengths[][3] = {"hh","h","ll","l","j","z","\0"};
598
592
if (p -> length == 0 )
599
593
{
600
594
p -> is_signed = ((signed char )n < 0 ? 1 : 0 );
@@ -692,10 +686,7 @@ t_print *parse_conversion(t_print *p)
692
686
fmt_str (p );
693
687
else if (p -> buf [p -> i ] == 'S' )
694
688
{
695
- if (MB_CUR_MAX > 1 )
696
- fmt_wstr (p );
697
- else
698
- fmt_str (p );
689
+ fmt_wstr (p );
699
690
}
700
691
else if (p -> buf [p -> i ] == 'd' || p -> buf [p -> i ] == 'i' || p -> buf [p -> i ] == 'D' )
701
692
{
@@ -706,7 +697,6 @@ t_print *parse_conversion(t_print *p)
706
697
fmt_hex (p , 0 );
707
698
else if (p -> buf [p -> i ] == 'p' )
708
699
{
709
- // p->f_alt = 1;
710
700
p -> length = 3 ;
711
701
fmt_ptr (p );
712
702
}
@@ -780,13 +770,8 @@ int ft_printf(const char *format, ...)
780
770
parse_conversion (parse_length (parse_precision (parse_width (parse_flags (parse_percent (p ))))));
781
771
}
782
772
va_end (p -> ap );
783
- // ft_putstrc(p->out, 200, 20, 20);
784
773
len = p -> r ;
785
774
write (1 , p -> out , len );
786
- // print_struct(p);
787
- // ft_putstr("ret: ");
788
- // ft_putnbr(len);
789
- // ft_putchar('\n');
790
775
ft_strdel (& p -> buf );
791
776
ft_strdel (& p -> out );
792
777
free (p );
0 commit comments