diff --git a/ChangeLog b/ChangeLog index 1774a783..34ecb50c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21836,3 +21836,5 @@ * Cleaned up compile warnings in rdrepld(8). 2021-06-02 Fred Gleason * Cleaned up compile warnings in ripcd(8). +2021-06-02 Fred Gleason + * Cleaned up compile warnings in the 'test_pam' harness. diff --git a/tests/test_pam.cpp b/tests/test_pam.cpp index f48ee387..2182d530 100644 --- a/tests/test_pam.cpp +++ b/tests/test_pam.cpp @@ -51,7 +51,9 @@ int ConversationResponseCallback(int num_msg,const struct pam_message **msg, case PAM_PROMPT_ECHO_ON: printf("%s ",msg[i]->msg); fflush(NULL); - fgets(resp[i]->resp,256,stdin); + if(fgets(resp[i]->resp,256,stdin)==NULL) { + fprintf(stderr,"failed to read prompt!\n"); + } resp[i]->resp[strlen(resp[i]->resp)-1]=0; resp[i]->resp_retcode=0; break;