Skip to content

Commit fa5571e

Browse files
author
itayzafrir
committed
Add file mbed_app.json for new line character handling
Example file main.cpp updated to use '\n' instead of '\r\n'.
1 parent 8496542 commit fa5571e

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

main.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
if((actual) != (expected)) \
3333
{ \
3434
mbedtls_printf( "\tassertion failed at %s:%d - " \
35-
"actual:%" PRId32 "expected:%" PRId32 "\r\n", \
35+
"actual:%" PRId32 "expected:%" PRId32 "\n", \
3636
__FILE__, __LINE__, \
3737
(psa_status_t) actual, (psa_status_t) expected ); \
3838
goto exit; \
@@ -44,12 +44,12 @@
4444
!defined(MBEDTLS_CIPHER_MODE_WITH_PADDING)
4545
int main(void)
4646
{
47-
mbedtls_printf("Not all of the required options are defined:\r\n"
48-
" - MBEDTLS_PSA_CRYPTO_C\r\n"
49-
" - MBEDTLS_AES_C\r\n"
50-
" - MBEDTLS_CIPHER_MODE_CBC\r\n"
51-
" - MBEDTLS_CIPHER_MODE_CTR\r\n"
52-
" - MBEDTLS_CIPHER_MODE_WITH_PADDING\r\n");
47+
mbedtls_printf("Not all of the required options are defined:\n"
48+
" - MBEDTLS_PSA_CRYPTO_C\n"
49+
" - MBEDTLS_AES_C\n"
50+
" - MBEDTLS_CIPHER_MODE_CBC\n"
51+
" - MBEDTLS_CIPHER_MODE_CTR\n"
52+
" - MBEDTLS_CIPHER_MODE_WITH_PADDING\n");
5353
return 0;
5454
}
5555
#else
@@ -309,22 +309,22 @@ static void cipher_examples(void)
309309
{
310310
psa_status_t status;
311311

312-
mbedtls_printf("cipher encrypt/decrypt AES CBC no padding:\r\n");
312+
mbedtls_printf("cipher encrypt/decrypt AES CBC no padding:\n");
313313
status = cipher_example_encrypt_decrypt_aes_cbc_nopad_1_block();
314314
if (status == PSA_SUCCESS) {
315-
mbedtls_printf("\tsuccess!\r\n");
315+
mbedtls_printf("\tsuccess!\n");
316316
}
317317

318-
mbedtls_printf("cipher encrypt/decrypt AES CBC PKCS7 multipart:\r\n");
318+
mbedtls_printf("cipher encrypt/decrypt AES CBC PKCS7 multipart:\n");
319319
status = cipher_example_encrypt_decrypt_aes_cbc_pkcs7_multi();
320320
if (status == PSA_SUCCESS) {
321-
mbedtls_printf("\tsuccess!\r\n");
321+
mbedtls_printf("\tsuccess!\n");
322322
}
323323

324-
mbedtls_printf("cipher encrypt/decrypt AES CTR multipart:\r\n");
324+
mbedtls_printf("cipher encrypt/decrypt AES CTR multipart:\n");
325325
status = cipher_example_encrypt_decrypt_aes_ctr_multi();
326326
if (status == PSA_SUCCESS) {
327-
mbedtls_printf("\tsuccess!\r\n");
327+
mbedtls_printf("\tsuccess!\n");
328328
}
329329
}
330330

mbed_app.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"target_overrides": {
3+
"*": {
4+
"platform.stdio-convert-newlines": true
5+
}
6+
}
7+
}
8+

0 commit comments

Comments
 (0)