From: N. Brouard Date: Thu, 29 Oct 2009 13:18:53 +0000 (+0000) Subject: (Module): Now imach stops if date of birth, at least year of birth, is not given... X-Git-Tag: imach-099s7~462 X-Git-Url: https://henry.ined.fr/git/?a=commitdiff_plain;h=21b9ac45b1cb03ea892ff8355a16d3fe7d4f2e2c;p=.git (Module): Now imach stops if date of birth, at least year of birth, is not given. Some cleaning of the code. --- diff --git a/src/imach.c b/src/imach.c index 165563b..da7d697 100644 --- a/src/imach.c +++ b/src/imach.c @@ -1,6 +1,9 @@ /* $Id$ $State$ $Log$ + Revision 1.133 2009/07/06 10:21:25 brouard + just nforces + Revision 1.132 2009/07/06 08:22:05 brouard Many tings @@ -403,7 +406,7 @@ extern int errno; /* $Id$ */ /* $State$ */ -char version[]="Imach version 0.98k, June 2009, INED-EUROREVES-Institut de longevite "; +char version[]="Imach version 0.98l, October 2009, INED-EUROREVES-Institut de longevite "; char fullversion[]="$Revision$ $Date$"; char strstart[80]; char optionfilext[10], optionfilefiname[FILENAMELENGTH]; @@ -4942,9 +4945,15 @@ run imach with mle=-1 to get a correct template of the parameter file.\n",numlin month=99; year=9999; }else{ - printf("Error reading data around '%s' at line number %ld %s for individual %d, '%s'\nShould be a date of birth (mm/yyyy or .). Exiting.\n",strb, linei,i,line,j); - fprintf(ficlog,"Error reading data around '%s' at line number %ld %s for individual %d, '%s'\nShould be a date of birth (mm/yyyy or .). Exiting.\n",strb, linei,i,line,j);fflush(ficlog); + printf("Error reading data around '%s' at line number %ld for individual %d, '%s'\nShould be a date of birth (mm/yyyy or .). Exiting.\n",strb, linei,i,line); + fprintf(ficlog,"Error reading data around '%s' at line number %ld for individual %d, '%s'\nShould be a date of birth (mm/yyyy or .). Exiting.\n",strb, linei,i,line);fflush(ficlog); + goto end; + } + if (year==9999) { + printf("Error reading data around '%s' at line number %ld for individual %d, '%s'\nShould be a date of birth (mm/yyyy) but at least the year of birth should be given. Exiting.\n",strb, linei,i,line); + fprintf(ficlog,"Error reading data around '%s' at line number %ld for individual %d, '%s'\nShould be a date of birth (mm/yyyy) but at least the year of birth should be given. Exiting.\n",strb, linei,i,line);fflush(ficlog); goto end; + } annais[i]=(double)(year); moisnais[i]=(double)(month); @@ -5169,7 +5178,7 @@ run imach with mle=-1 to get a correct template of the parameter file.\n",numlin agev[m][i]=1; else if(agev[m][i] agemax){ agemax=agev[m][i];