Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > ParamHelper
comparison ReadParamsFromFile.c @ 2:8f6d8a258491
Not sure what changed but works
| author | Me |
|---|---|
| date | Wed, 28 Jul 2010 13:17:25 -0700 |
| parents | 481dd533f0e8 |
| children | e5c04a3a2610 |
comparison
equal
deleted
inserted
replaced
| 0:57e4588e7a64 | 1:cff988a513a3 |
|---|---|
| 43 char* paramValue;// = malloc( 500 ); //max of 500 chars in value | 43 char* paramValue;// = malloc( 500 ); //max of 500 chars in value |
| 44 | 44 |
| 45 lineSz = 500; //max length of line in a config file | 45 lineSz = 500; //max length of line in a config file |
| 46 line = (char *) malloc( lineSz ); | 46 line = (char *) malloc( lineSz ); |
| 47 if( line == NULL ) | 47 if( line == NULL ) |
| 48 { BLIS_DKU__throwError( "no mem for line" ); | 48 { printf( "\nIn readParamFileIntoBag: no mem for line\n" ); |
| 49 return; | 49 return; |
| 50 } | 50 } |
| 51 | 51 |
| 52 | 52 |
| 53 paramFile = fopen( paramFileName, "r" ); | 53 paramFile = fopen( paramFileName, "r" ); |
| 54 if( paramFile == NULL ) {printf("\ncouldn't open file\n"); exit(0);} | |
| 54 fseek( paramFile, 0, SEEK_SET ); | 55 fseek( paramFile, 0, SEEK_SET ); |
| 55 while( !feof( paramFile ) ) | 56 while( !feof( paramFile ) ) |
| 56 { while( getline( &line, &lineSz, paramFile ) != -1 ) | 57 { while( getline( &line, &lineSz, paramFile ) != -1 ) |
| 57 { | 58 { |
| 58 char *lineEnd = line + strlen(line) +1; | 59 char *lineEnd = line + strlen(line) +1; |
