]> git.cryptolib.org Git - arm-crypto-lib.git/blobdiff - test_src/cli.c
'hardening' infrastucture against toolchain bugs
[arm-crypto-lib.git] / test_src / cli.c
index 8176d5ff8cc4e7d655cce4ab006ecf0eacfebb9d..c9e1b31aabc3a144a4cc512b063c99d6f99bec65 100644 (file)
@@ -102,7 +102,8 @@ uint8_t cli_getsn(char* s, uint32_t n){
        char c;
        if(n==0)
                return 2;
-       while((c=cli_getc_cecho())!='\0' && c!='\r' && n--){
+       while((c=cli_getc_cecho())!='\0' && c!='\r' && n){
+               --n;
                *s++=c;
        }
        *s='\0';