@@ -178,12 +178,14 @@ struct termios saved_tty_parameters;
178178
179179char * abort_string [MAX_ABORTS ], * fail_reason = (char * )0 ,
180180 fail_buffer [50 ];
181- int n_aborts = 0 , abort_next = 0 , timeout_next = 0 , echo_next = 0 ;
181+ size_t n_aborts = 0 ;
182+ int abort_next = 0 , timeout_next = 0 , echo_next = 0 ;
182183int clear_abort_next = 0 ;
183184
184185char * report_string [MAX_REPORTS ] ;
185186char report_buffer [4096 ] ;
186- int n_reports = 0 , report_next = 0 , report_gathering = 0 ;
187+ size_t n_reports = 0 ;
188+ int report_next = 0 , report_gathering = 0 ;
187189int clear_report_next = 0 ;
188190
189191int say_next = 0 , hup_next = 0 ;
@@ -606,15 +608,15 @@ void terminate(int status)
606608 * Allow the last of the report string to be gathered before we terminate.
607609 */
608610 if (report_gathering ) {
609- int c , rep_len ;
611+ int c ;
610612
611- rep_len = strlen (report_buffer );
613+ size_t rep_len = strlen (report_buffer );
612614 while (rep_len + 1 < sizeof (report_buffer )) {
613615 alarm (1 );
614616 c = get_char ();
615617 alarm (0 );
616618 if (c < 0 || iscntrl (c ))
617- break ;
619+ break ;
618620 report_buffer [rep_len ] = c ;
619621 ++ rep_len ;
620622 }
@@ -1342,7 +1344,8 @@ int echo_stderr(int n)
13421344int get_string (register char * string )
13431345{
13441346 char temp [STR_LEN ];
1345- int c , printed = 0 , len , minlen ;
1347+ int c , printed = 0 ;
1348+ size_t len , minlen ;
13461349 register char * s = temp , * end = s + STR_LEN ;
13471350 char * s1 , * logged = temp ;
13481351
@@ -1372,11 +1375,11 @@ int get_string(register char *string)
13721375 alarmed = 0 ;
13731376
13741377 while ( ! alarmed && (c = get_char ()) >= 0 ) {
1375- int n , abort_len , report_len ;
1378+ size_t n , abort_len , report_len ;
13761379
13771380 if (echo ) {
13781381 if (echo_stderr (c ) != 0 ) {
1379- fatal (2 , "Could not write to stderr, %m" );
1382+ fatal (2 , "Could not write to stderr, %m" );
13801383 }
13811384 }
13821385 if (verbose && c == '\n' ) {
@@ -1421,8 +1424,8 @@ int get_string(register char *string)
14211424 }
14221425 else {
14231426 if (!iscntrl (c )) {
1424- int rep_len = strlen (report_buffer );
1425- if (( rep_len + 1 ) < sizeof (report_buffer )) {
1427+ size_t rep_len = strlen (report_buffer );
1428+ if (rep_len < sizeof (report_buffer ) - 1 ) {
14261429 report_buffer [rep_len ] = c ;
14271430 report_buffer [rep_len + 1 ] = '\0' ;
14281431 }
0 commit comments