phoenix-rtos / phoenix-rtos-project

Sample project using Phoenix-RTOS
https://phoenix-rtos.com
BSD 3-Clause "New" or "Revised" License
44 stars 32 forks source link

Scanf doesn't support output size modifiers. #681

Open maska989 opened 1 year ago

maska989 commented 1 year ago

int main(void) {

float flt = 3.123412341234e+17,
      fltVal,
      fltValSup;

char buff[50];

sprintf(buff, "%f", flt);

printf("\nscanf = %d\n", sscanf(buff, "%5f %f", &fltVal, &fltValSup));
printf("\n%f %f \n", fltVal, fltValSup);

}



* Output between host-generic-pc and ia32-generic-qemu:

![Screenshot from 2023-04-05 09-08-03](https://user-images.githubusercontent.com/49757239/230006677-3df1cb10-274a-4c3c-b4e1-f08ce70e9c35.png)
maska989 commented 1 year ago

https://github.com/phoenix-rtos/phoenix-rtos-tests/blob/c13ef424dff7c1f0f88f02e4a67104f6d9ed5d22/libc/stdio_scanf.c#L4536