X-Git-Url: https://git.cryptolib.org/?p=arm-crypto-lib.git;a=blobdiff_plain;f=test_src%2Fcli.c;h=c9e1b31aabc3a144a4cc512b063c99d6f99bec65;hp=d517829049a581ef2ae34b212f57e58c95ead09e;hb=a0b23b3327c8bc2ecd7278c95662fdebf6f15d6b;hpb=498cf95d73faff93a848d2c0ffec3987769670bb diff --git a/test_src/cli.c b/test_src/cli.c index d517829..c9e1b31 100644 --- a/test_src/cli.c +++ b/test_src/cli.c @@ -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';