Thank you for the report. But I can not reproduce it with the following case:
#include <stdio.h> int main () { char moo[16] = {'c','c','c','c', 'c','c','c','c', 'c','c','c','c', 'c','c','c','c'};
printf("%.*s\n", 10, moo); printf("%.*s\n", 16, moo); return 0; }
arm-none-eabi-gcc -mcpu=cortex-m0 -mthumb -O2 printf.c --specs=nano.specs -specs=rdimon.specs ./a.out cccccccccc cccccccccccccccc
The output are correct.
Can you show us more detail about your case?
Thank you for the report. But I can not reproduce it with the following case:
#include <stdio.h>
'c' ,'c','c' ,'c',
'c' ,'c','c' ,'c',
'c' ,'c','c' ,'c'};
int main ()
{
char moo[16] = {'c','c','c','c',
printf("%.*s\n", 10, moo);
printf("%.*s\n", 16, moo);
return 0;
}
arm-none-eabi-gcc -mcpu=cortex-m0 -mthumb -O2 printf.c --specs=nano.specs -specs=rdimon.specs
./a.out
cccccccccc
cccccccccccccccc
The output are correct.
Can you show us more detail about your case?