@@ -221,6 +221,7 @@ int main (int argc, char *argv[])
221
221
222
222
if (num_clients < 1 || num_clients > MAX_CLIENTS ) {
223
223
printf ("Specify up to %d TNCs on the command line.\n" , MAX_CLIENTS );
224
+ dw_printf ("\e[0m\e\n\e[0J\e" );
224
225
exit (1 );
225
226
}
226
227
@@ -236,13 +237,15 @@ int main (int argc, char *argv[])
236
237
p = strtok (stemp , "=" );
237
238
if (p == NULL ) {
238
239
printf ("Internal error 1\n" );
240
+ dw_printf ("\e[0m\e\n\e[0J\e" );
239
241
exit (1 );
240
242
}
241
243
strlcpy (hostname [j ], "localhost" , sizeof (hostname [j ]));
242
244
strlcpy (port [j ], p , sizeof (port [j ]));
243
245
p = strtok (NULL , "=" );
244
246
if (p == NULL ) {
245
247
printf ("Missing description after %s\n" , port [j ]);
248
+ dw_printf ("\e[0m\e\n\e[0J\e" );
246
249
exit (1 );
247
250
}
248
251
strlcpy (description [j ], p , sizeof (description [j ]));
@@ -291,6 +294,7 @@ int main (int argc, char *argv[])
291
294
}
292
295
if (client_th [j ] == NULL ) {
293
296
printf ("Internal error: Could not create client thread %d.\n" , j );
297
+ dw_printf ("\e[0m\e\n\e[0J\e" );
294
298
exit (1 );
295
299
}
296
300
#else
@@ -302,6 +306,7 @@ int main (int argc, char *argv[])
302
306
}
303
307
if (e != 0 ) {
304
308
perror ("Internal error: Could not create client thread." );
309
+ dw_printf ("\e[0m\e\n\e[0J\e" );
305
310
exit (1 );
306
311
}
307
312
#endif
@@ -438,6 +443,7 @@ static void * client_thread_net (void *arg)
438
443
hostname [my_index ], gai_strerror (err ));
439
444
#endif
440
445
freeaddrinfo (ai_head );
446
+ dw_printf ("\e[0m\e\n\e[0J\e" );
441
447
exit (1 );
442
448
}
443
449
@@ -536,6 +542,7 @@ static void * client_thread_net (void *arg)
536
542
537
543
printf ("Client %d unable to connect to %s on %s (%s), port %s\n" ,
538
544
my_index , description [my_index ], hostname [my_index ], ipaddr_str , port [my_index ] );
545
+ dw_printf ("\e[0m\e\n\e[0J\e" );
539
546
exit (1 );
540
547
}
541
548
@@ -563,6 +570,7 @@ static void * client_thread_net (void *arg)
563
570
564
571
if (n != sizeof (mon_cmd )) {
565
572
printf ("Read error, client %d received %d command bytes. Terminating.\n" , my_index , n );
573
+ dw_printf ("\e[0m\e\n\e[0J\e" );
566
574
exit (1 );
567
575
}
568
576
@@ -577,6 +585,7 @@ static void * client_thread_net (void *arg)
577
585
578
586
if (n != mon_cmd .data_len ) {
579
587
printf ("Read error, client %d received %d data bytes.\n" , my_index , n );
588
+ dw_printf ("\e[0m\e\n\e[0J\e" );
580
589
exit (1 );
581
590
}
582
591
}
@@ -682,6 +691,7 @@ static void * client_thread_serial (void *arg)
682
691
if (fd == MYFDERROR ) {
683
692
printf ("Client %d unable to connect to %s on %s.\n" ,
684
693
my_index , description [my_index ], port [my_index ] );
694
+ dw_printf ("\e[0m\e\n\e[0J\e" );
685
695
exit (1 );
686
696
}
687
697
@@ -732,6 +742,7 @@ static void * client_thread_serial (void *arg)
732
742
if (fd == MYFDERROR ) {
733
743
printf ("Client %d unable to connect to %s on %s.\n" ,
734
744
my_index , description [my_index ], port [my_index ] );
745
+ dw_printf ("\e[0m\e\n\e[0J\e" );
735
746
exit (1 );
736
747
}
737
748
@@ -781,6 +792,7 @@ static void * client_thread_serial (void *arg)
781
792
if (! ReadFile (fd , & ch , 1 , & n , NULL )) {
782
793
printf ("Read error on %s.\n" , description [my_index ]);
783
794
CloseHandle (fd );
795
+ dw_printf ("\e[0m\e\n\e[0J\e" );
784
796
exit (1 );
785
797
}
786
798
@@ -790,6 +802,7 @@ static void * client_thread_serial (void *arg)
790
802
if ( ( n = read (fd , & ch , 1 )) < 0 ) {
791
803
printf ("Read error on %s.\n" , description [my_index ]);
792
804
close (fd );
805
+ dw_printf ("\e[0m\e\n\e[0J\e" );
793
806
exit (1 );
794
807
}
795
808
#endif
0 commit comments