Skip to content

Commit cc5e076

Browse files
committed
fixed some incorrect auto-formatting
1 parent 20eb8f3 commit cc5e076

File tree

1 file changed

+13
-13
lines changed
  • ch03_02_read_entire_file

1 file changed

+13
-13
lines changed

ch03_02_read_entire_file/main.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,32 @@ Repository: https://github.com/capnramses/pro_programming_tools_c_cpp
99
#include <string.h>
1010

1111
struct file_record_t {
12-
void* data;
12+
void* data;
1313
size_t sz;
1414
};
15-
15+
1616
struct file_record_t read_file( const char* filename ) {
17-
struct file_record_t record;
17+
struct file_record_t record;
1818
memset( &record, 0, sizeof( struct file_record_t ) );
19-
19+
2020
FILE* fp = fopen( filename, "rb" );
21-
if ( !fp ) { return record; }
21+
if ( !fp ) { return record; }
2222
fseek( fp, 0L, SEEK_END );
2323
record.sz = (size_t)ftell( fp );
2424
record.data = malloc( record.sz );
2525
rewind( fp );
2626
fread( record.data, record.sz, 1, fp );
2727
fclose( fp );
28-
28+
2929
return record;
3030
}
3131

3232
int main() {
33-
struct file_record_t record = read_file( "in.ppm" );
34-
if ( !record.data ) {
35-
fprintf( stderr, "ERROR: reading file `in.ppm`\n" );
36-
return 1;
37-
}
38-
printf( "put entire file `in.ppm` in memory. %u bytes. data %p\n", (unsigned int)record.sz, (void*)record.data );
39-
return 0;
33+
struct file_record_t record = read_file( "in.ppm" );
34+
if ( !record.data ) {
35+
fprintf( stderr, "ERROR: reading file `in.ppm`\n" );
36+
return 1;
37+
}
38+
printf( "put entire file `in.ppm` in memory. %u bytes. data %p\n", (unsigned int)record.sz, (void*)record.data );
39+
return 0;
4040
}

0 commit comments

Comments
 (0)