X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=source%2Funres%2Fsrc_CSA%2Fcompinfo.c;h=d20b2c9047a69497f96ef0b80130a7f52ef78547;hb=f48be89b572da15fc7bc0268de1f277e831afb36;hp=177dbd30f2671d8be3eba9bcbbe5feb9237f5c00;hpb=872cf2b5e368d0770780b0b2614c75f8e50f5608;p=unres.git diff --git a/source/unres/src_CSA/compinfo.c b/source/unres/src_CSA/compinfo.c index 177dbd3..d20b2c9 100644 --- a/source/unres/src_CSA/compinfo.c +++ b/source/unres/src_CSA/compinfo.c @@ -14,10 +14,10 @@ time_t Tp; in=fopen("cinfo.f","r"); out=fopen("cinfo.f.new","w"); -fgets(buf,498,in); -fprintf(out,"C DO NOT EDIT THIS FILE - IT HAS BEEN GENERATED BY COMPINFO.C\n"); -fgets(buf,498,in); -sscanf(&buf[1],"%d %d %d",&iv1,&iv2,&iv3); +if (fgets(buf,498,in) != NULL) + fprintf(out,"C DO NOT EDIT THIS FILE - IT HAS BEEN GENERATED BY COMPINFO.C\n"); +if (fgets(buf,498,in) != NULL) + sscanf(&buf[1],"%d %d %d",&iv1,&iv2,&iv3); iv3++; fprintf(out,"C %d %d %d\n",iv1,iv2,iv3); fprintf(out," subroutine cinfo\n");