Skip to content

Commit 975fe9b

Browse files
committed
cleanup
1 parent d14fd02 commit 975fe9b

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

totp.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ SHRINKELF
77
#STRIPFLAG
88

99
COMPILE printf itodec memcpy bzero memset write sleep \
10-
select tcgetattr tcsetattr signal _execlp fmtp snprintf fmtl atol \
11-
localtime_r mktime execvp sprintf
12-
COMPILE fmtp open error MLVALIST strncpy
10+
select tcgetattr tcsetattr signal _execlp snprintf atol \
11+
localtime_r mktime execvp
12+
COMPILE fmtp fmtl fmtd open error MLVALIST strncpy
1313

1414
if [ "$compile_sntp" = "1" ]; then
1515
source sntp/sntp.c
@@ -175,7 +175,7 @@ void usage(){
175175
" d=day,h=hour,m=minute. Can be supplied several times, or with -t/-T\n"
176176
" -n source : use ntpc time, source one of a,c,f,g,m\n"
177177
" (apple,cloudflare,facebook,google,microsoft)\n"
178-
" careful, microsoft will crash or point to apple - type jicrosoft or icrosoft instead\n"
178+
" (m)icrosoft will crash or point to apple - type jicrosoft or icrosoft instead\n"
179179
" -b secret : base32 secret \n"
180180
" -s N[h|m] : Set timeout, stop after N seconds (minutes, hours) without keypress,\n"
181181
" and erase all secrets.\n"
@@ -683,7 +683,7 @@ int main(int argc, char **argv, char **envp){
683683
break;
684684
case 'n':
685685
case '\n':
686-
P("Copy Next");
686+
P("Copy Next ");
687687
left(16);
688688
xclip(r2);
689689
clsec = 3;
@@ -692,11 +692,8 @@ int main(int argc, char **argv, char **envp){
692692
sleep(1); // aborted by sigalarm
693693
seconds ++;
694694

695-
if ( clsec ){
696-
if ( clsec==1 )
697-
P("\e[2K");
698-
clsec --;
699-
}
695+
if ( clsec && !--clsec )
696+
P("\e[2K"); // clear line
700697
}
701698
up();
702699
};

vt100.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ void right(uint cols){
7676
}
7777

7878
void left(uint cols){
79-
char buf[16];
80-
int l = snprintf(buf,16,"\e[%uD",cols);
79+
char buf[16];// = { '\033', '[',
80+
int l = snprintf(buf,16,"\033[%dD",cols);
8181
write(1,buf,l);
8282
}
8383

0 commit comments

Comments
 (0)