X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;ds=inline;f=source%2Funres%2Fsrc_MD%2Fcompinfo.c;h=d20b2c9047a69497f96ef0b80130a7f52ef78547;hb=278ef5360168c7eedc47b233648d4d12c4bd473c;hp=7e2b9cfeaf1e2cdf18cc10b32f3308b7444a9382;hpb=478a9d9a1c99eb3f4bc4ca676ff3162bdd01d633;p=unres.git diff --git a/source/unres/src_MD/compinfo.c b/source/unres/src_MD/compinfo.c index 7e2b9cf..d20b2c9 100644 --- a/source/unres/src_MD/compinfo.c +++ b/source/unres/src_MD/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"); @@ -26,10 +26,11 @@ fprintf(out," write(iout,*)'++++ Compile info ++++'\n"); fprintf(out," write(iout,*)'Version %d.%-d build %d'\n",iv1,iv2,iv3); uname(&Name); time(&Tp); -system("rm tmptmp; whoami > tmptmp"); +system("whoami > tmptmp"); in1=fopen("tmptmp","r"); fscanf(in1,"%s",buf1); fclose(in1); +system("rm tmptmp"); p1=ctime(&Tp); p1[strlen(p1)-1]='\0'; fprintf(out," write(iout,*)'compiled %s'\n",p1);