]> 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 d517829049a581ef2ae34b212f57e58c95ead09e..c9e1b31aabc3a144a4cc512b063c99d6f99bec65 100644 (file)
@@ -1,6 +1,6 @@
 /* cli.c */
 /*
-    This file is part of the AVR-Crypto-Lib.
+    This file is part of the ARM-Crypto-Lib.
     Copyright (C) 2008  Daniel Otte (daniel.otte@rub.de)
 
     This program is free software: you can redistribute it and/or modify
@@ -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';