- if( filename != NULL ) {
- /* Trying to open the file. */
- fp = fopen( filename, "r" );
- if( fp == NULL ) {
- perror( PACKAGE );
- /*ErrorLocation( __FILE__, __LINE__ );*/
- exit( EXIT_FAILURE );
- }
- }
-
- /* Reading one line of data from the configuration file. */
- /* char *fgets(char *s, int size, FILE *stream);
- Reading stops after an EOF or a newline. If a newline is read, it is
- stored into the buffer. A '\0' is stored after the last character in
- the buffer. */
- while( fgets( line, LINE_BUFFER_LEN, fp ) != NULL ) {
- i = 0;
- Checksum = 0;
+ if (filename == NULL) {
+ printf("%s: No file specified\n", PACKAGE);
+ exit(EXIT_FAILURE);
+ }
+
+ /* Trying to open the file. */
+ fp = fopen( filename, "r" );
+ if( fp == NULL ) {
+ perror( PACKAGE );
+ /*ErrorLocation( __FILE__, __LINE__ );*/
+ exit( EXIT_FAILURE );
+ }
+
+ /* Reading one line of data from the hex file. */
+ /* char *fgets(char *s, int size, FILE *stream);
+ Reading stops after an EOF or a newline. If a newline is read, it is
+ stored into the buffer. A '\0' is stored after the last character in
+ the buffer. */
+ while( fgets( line, LINE_BUFFER_LEN, fp ) != NULL ) {
+ i = 0;
+ Checksum = 0;