From 61b8806cf3a1164ae145d42cc48ca7c432e2ab53 Mon Sep 17 00:00:00 2001 From: Magnus Lundborg Date: Thu, 21 Mar 2013 09:49:08 +0100 Subject: Print file position when failing to read block headers. diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c index 66e7780..fdb7809 100644 --- a/src/lib/tng_io.c +++ b/src/lib/tng_io.c @@ -6095,7 +6095,8 @@ static tng_function_status tng_frame_set_align(tng_trajectory_t tng_data) { if(tng_block_header_read(tng_data, block) != TNG_SUCCESS) { - printf("Cannot read block header. %s: %d\n", __FILE__, __LINE__); + printf("Cannot read block header at pos %"PRId64". %s: %d\n", pos, + __FILE__, __LINE__); tng_data->input_file = temp; tng_block_destroy(&block); return(TNG_CRITICAL); @@ -6183,7 +6184,8 @@ static tng_function_status tng_frame_set_finalize { if(tng_block_header_read(tng_data, block) != TNG_SUCCESS) { - printf("Cannot read block header. %s: %d\n", __FILE__, __LINE__); + printf("Cannot read block header at pos %"PRId64". %s: %d\n", pos, + __FILE__, __LINE__); tng_data->input_file = temp; tng_block_destroy(&block); return(TNG_CRITICAL); -- cgit v0.10.1