1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

Changeset 600

Show
Ignore:
Timestamp:
09/02/09 19:08:48 (4 years ago)
Author:
rjuengling
Message:

handle format character 'c' in printf (tentative solution)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lush2/src/io.c

    r599 r600  
    10531053 
    10541054/* 
    1055  * printf C'printf interface. format: %{-}{n}{.{m}}{d|s|f|e|g|l|p}  ( l for 
     1055 * printf C'printf interface. format: %{-}{n}{.{m}}{c|d|s|f|e|g|l|p}  ( l for 
    10561056 * list, p for pretty ) or   : %% 
    10571057 */ 
     
    11121112            break; 
    11131113         case 'd': 
     1114         case 'c': 
    11141115         case 's': 
    11151116            if (ok >= 5) 
     
    11661167         } 
    11671168 
     1169      } else if (c == 'c') { 
     1170         *buf++ = 0; 
     1171         if (ok == 9) { 
     1172            print_char((char)AINTEGER(i)); 
     1173         } else if (n > print_buffer + LINE_BUFFER - buf - 1) { 
     1174            goto err_printf0; 
     1175         } else { 
     1176            sprintf(buf, print_buffer, (char)AINTEGER(i)); 
     1177            print_string(buf); 
     1178         } 
     1179 
    11681180      } else if (c == 'd') { 
    11691181         *buf++ = 0;