Whamcloud - gitweb
ChangeLog, util.c:
authorTheodore Ts'o <tytso@mit.edu>
Wed, 23 Aug 2000 04:36:25 +0000 (04:36 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 23 Aug 2000 04:36:25 +0000 (04:36 +0000)
  util.c (string_to_inode): Use strtoul instead of atoi, so that hex
   inode numbers will be accepted.

debugfs/ChangeLog
debugfs/util.c

index a55751a..3169c13 100644 (file)
@@ -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
index d11578d..70c5d3f 100644 (file)
@@ -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);