summaryrefslogtreecommitdiff
path: root/debugfs
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2000-08-23 04:36:25 +0000
committerTheodore Ts'o <tytso@mit.edu>2000-08-23 04:36:25 +0000
commit9131a759318963d9c86a7de7138ac8cee9641f8c (patch)
tree38a97f654e325a5267340d654f37f61e9485f1ed /debugfs
parent2575fb04439938a9ca3e34d06409cca378d84357 (diff)
downloade2fsprogs-9131a759318963d9c86a7de7138ac8cee9641f8c.tar.gz
ChangeLog, util.c:
util.c (string_to_inode): Use strtoul instead of atoi, so that hex inode numbers will be accepted.
Diffstat (limited to 'debugfs')
-rw-r--r--debugfs/ChangeLog5
-rw-r--r--debugfs/util.c10
2 files changed, 9 insertions, 6 deletions
diff --git a/debugfs/ChangeLog b/debugfs/ChangeLog
index a55751af..3169c137 100644
--- a/debugfs/ChangeLog
+++ b/debugfs/ChangeLog
@@ -1,3 +1,8 @@
+2000-08-23 <tytso@valinux.com>
+
+ * util.c (string_to_inode): Use strtoul instead of atoi, so that
+ hex inode numbers will be accepted.
+
2000-08-19 <tytso@valinux.com>
* util.c (open_pager): Set SIGPIPE to be ignored, so that quitting
diff --git a/debugfs/util.c b/debugfs/util.c
index d11578d6..70c5d3f7 100644
--- a/debugfs/util.c
+++ b/debugfs/util.c
@@ -45,7 +45,7 @@ ino_t string_to_inode(char *str)
{
ino_t ino;
int len = strlen(str);
- int i;
+ char *end;
int retval;
/*
@@ -53,11 +53,9 @@ ino_t string_to_inode(char *str)
* inode number.
*/
if ((len > 2) && (str[0] == '<') && (str[len-1] == '>')) {
- for (i = 1; i < len-1; i++)
- if (!isdigit(str[i]))
- break;
- if (i == len-1)
- return(atoi(str+1));
+ ino = strtoul(str+1, &end, 0);
+ if (*end=='>')
+ return ino;
}
retval = ext2fs_namei(current_fs, root, cwd, str, &ino);