Clear return buffer in case of error

This commit is contained in:
Charles-Edouard de la Vergne 2024-03-13 14:24:03 +01:00
parent ae8d1f7607
commit 6541cf32f8
No known key found for this signature in database
GPG Key ID: F12296941B7BB9C6

View File

@ -50,6 +50,9 @@ void app_main(void) {
sw = gpg_dispatch(); sw = gpg_dispatch();
if (sw) { if (sw) {
PRINTF("[MAIN] - FINALLY INSERT sw=0x%x\n", sw); PRINTF("[MAIN] - FINALLY INSERT sw=0x%x\n", sw);
if ((sw != SW_OK) && ((sw & 0xFF00) != SW_CORRECT_BYTES_AVAILABLE)) {
gpg_io_discard(1);
}
gpg_io_insert_u16(sw); gpg_io_insert_u16(sw);
io_flags = 0; io_flags = 0;
} else { } else {