diff options
Diffstat (limited to 'dev/afccheck.c')
| -rw-r--r-- | dev/afccheck.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/dev/afccheck.c b/dev/afccheck.c index d06a147..a9b666e 100644 --- a/dev/afccheck.c +++ b/dev/afccheck.c | |||
| @@ -45,6 +45,8 @@ void check_afc(gpointer data) | |||
| 45 | int *buf = (int *) malloc(buffersize); | 45 | int *buf = (int *) malloc(buffersize); |
| 46 | int *buf2 = (int *) malloc(buffersize); | 46 | int *buf2 = (int *) malloc(buffersize); |
| 47 | unsigned int bytes = 0; | 47 | unsigned int bytes = 0; |
| 48 | uint64_t position = 0; | ||
| 49 | |||
| 48 | //fill buffer | 50 | //fill buffer |
| 49 | int i = 0; | 51 | int i = 0; |
| 50 | for (i = 0; i < BUFFER_SIZE; i++) { | 52 | for (i = 0; i < BUFFER_SIZE; i++) { |
| @@ -65,9 +67,12 @@ void check_afc(gpointer data) | |||
| 65 | //now read it | 67 | //now read it |
| 66 | bytes = 0; | 68 | bytes = 0; |
| 67 | afc_file_open(((param *) data)->afc, path, AFC_FOPEN_RDONLY, &file); | 69 | afc_file_open(((param *) data)->afc, path, AFC_FOPEN_RDONLY, &file); |
| 68 | afc_file_read(((param *) data)->afc, file, (char *) buf2, buffersize, &bytes); | 70 | afc_file_read(((param *) data)->afc, file, (char *) buf2, buffersize/2, &bytes); |
| 71 | afc_file_read(((param *) data)->afc, file, (char *) buf2 + (buffersize/2), buffersize/2, &bytes); | ||
| 72 | if(AFC_E_SUCCESS != afc_file_tell(((param *) data)->afc, file, &position)) | ||
| 73 | printf("Tell operation failed\n"); | ||
| 69 | afc_file_close(((param *) data)->afc, file); | 74 | afc_file_close(((param *) data)->afc, file); |
| 70 | if (bytes != buffersize) | 75 | if (position != buffersize) |
| 71 | printf("Read operation failed\n"); | 76 | printf("Read operation failed\n"); |
| 72 | 77 | ||
| 73 | //compare buffers | 78 | //compare buffers |
