micropython/ports/unix
Joris Peeraer 5020b14d54 py/mpprint: Fix length calculation for strings with precision-modifier.
Two issues are tackled:

1. The calculation of the correct length to print is fixed to treat the
   precision as a maximum length instead as the exact length.
   This is done for both qstr (%q) and for regular str (%s).

2. Fix the incorrect use of mp_printf("%.*s") to mp_print_strn().

   Because of the fix of above issue, some testcases that would print
   an embedded null-byte (^@ in test-output) would now fail.
   The bug here is that "%s" was used to print null-bytes. Instead,
   mp_print_strn is used to make sure all bytes are outputted and the
   exact length is respected.

Test-cases are added for both %s and %q with a combination of precision
and padding specifiers.
2020-12-07 23:32:06 +11:00
..
variants
.gitignore
Makefile extmod/modbluetooth: Add API for L2CAP channels. 2020-11-24 01:07:17 +11:00
alloc.c
coverage.c py/mpprint: Fix length calculation for strings with precision-modifier. 2020-12-07 23:32:06 +11:00
coveragecpp.cpp
fatfs_port.c
gccollect.c
input.c
input.h
main.c
modffi.c
modjni.c
modmachine.c extmod/machine_mem: Only allow integers in machine.memX subscript. 2020-11-13 11:13:37 +11:00
modos.c
modtermios.c
modtime.c
moduos_vfs.c
moduselect.c
modusocket.c
mpbthciport.c extmod/nimble: Make stm32 and unix NimBLE ports use synchronous events. 2020-11-13 17:19:05 +11:00
mpbtstackport.h
mpbtstackport_common.c
mpbtstackport_h4.c
mpbtstackport_usb.c
mpconfigport.h unix: Handle pending events/scheduler in MICROPY_EVENT_POLL_HOOK. 2020-11-13 17:19:05 +11:00
mpconfigport.mk
mphalport.h unix: Make mp_hal_delay_ms run MICROPY_EVENT_POLL_HOOK. 2020-11-13 17:19:05 +11:00
mpnimbleport.c extmod/nimble: Make stm32 and unix NimBLE ports use synchronous events. 2020-11-13 17:19:05 +11:00
mpnimbleport.h
mpthreadport.c
mpthreadport.h
qstrdefsport.h
unix_mphal.c unix: Make mp_hal_delay_ms run MICROPY_EVENT_POLL_HOOK. 2020-11-13 17:19:05 +11:00