X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/65575e9670fb77ececc8255d572d08d7b10bb049..716baed7ff23f949861f0eb369c013408e17f984:/authenticate.c diff --git a/authenticate.c b/authenticate.c index 896366aa..885e40b6 100644 --- a/authenticate.c +++ b/authenticate.c @@ -170,8 +170,10 @@ static char *getpassf(char *filename) buffer[sizeof(buffer)-1]='\0'; if ( (len=read(fd,buffer,sizeof(buffer)-1)) > 0) { + char *p = strtok(buffer,"\n\r"); close(fd); - return strdup(strtok(buffer,"\n\r")); + if (p) p = strdup(p); + return p; } return NULL;