* Copyright (C) 1994, 1995, 2000 Theodore Ts'o.
*
* %Begin-Header%
- * This file may be redistributed under the terms of the GNU Public
- * License.
+ * This file may be redistributed under the terms of the GNU Library
+ * General Public License, version 2.
* %End-Header%
*/
+#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
void *priv_data))
{
errcode_t retval;
- blk_t blockno;
+ blk64_t blockno;
int count;
char buf[128];
while (!feof (f)) {
if (fgets(buf, sizeof(buf), f) == NULL)
break;
- count = sscanf(buf, "%u", &blockno);
+ count = sscanf(buf, "%llu", &blockno);
if (count <= 0)
continue;
+ /* Badblocks isn't going to be updated for 64bit */
+ if (blockno >> 32)
+ return EOVERFLOW;
if (fs &&
((blockno < fs->super->s_first_data_block) ||
- (blockno >= fs->super->s_blocks_count))) {
+ (blockno >= ext2fs_blocks_count(fs->super)))) {
if (invalid)
(invalid)(fs, blockno, buf, priv_data);
continue;