From f13048113f09def05a024470bfeaf44635bf7e98 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 25 Oct 1997 03:51:53 +0000 Subject: [PATCH] ChangeLog, debugfs.c, dump.c, ls.c: debugfs.c (main, do_open_filesys): dump.c (do_dump): Make the variable which getopt returns into be an int, so that it won't lose on platforms where char is unsigned. --- debugfs/ChangeLog | 7 +++++++ debugfs/debugfs.c | 4 ++-- debugfs/dump.c | 2 +- debugfs/ls.c | 7 +++---- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/debugfs/ChangeLog b/debugfs/ChangeLog index efd9acc..81a6fec 100644 --- a/debugfs/ChangeLog +++ b/debugfs/ChangeLog @@ -1,3 +1,10 @@ +Fri Oct 24 23:47:43 1997 Theodore Ts'o + + * debugfs.c (main, do_open_filesys): + * dump.c (do_dump): Make the variable which getopt returns into be + an int, so that it won't lose on platforms where char is + unsigned. + Tue Oct 14 21:50:24 1997 Theodore Ts'o * debugfs.c (main): When printing a usage message, have main diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c index 311aa1b..32dc601 100644 --- a/debugfs/debugfs.c +++ b/debugfs/debugfs.c @@ -74,7 +74,7 @@ errout: void do_open_filesys(int argc, char **argv) { const char *usage = "Usage: open [-w] "; - char c; + int c; int open_flags = 0; optind = 0; @@ -1409,7 +1409,7 @@ int main(int argc, char **argv) int retval; int sci_idx; const char *usage = "Usage: debugfs [[-w] device]"; - char c; + int c; int open_flags = 0; char *request = 0; int exit_status = 0; diff --git a/debugfs/dump.c b/debugfs/dump.c index 3997dfd..f56b2b1 100644 --- a/debugfs/dump.c +++ b/debugfs/dump.c @@ -186,7 +186,7 @@ void do_dump(int argc, char **argv) { ino_t inode; int fd; - char c; + int c; int preserve = 0; const char *dump_usage = "Usage: dump_inode [-p] "; char *in_fn, *out_fn; diff --git a/debugfs/ls.c b/debugfs/ls.c index 98c1d60..fe6df0a 100644 --- a/debugfs/ls.c +++ b/debugfs/ls.c @@ -43,7 +43,7 @@ static void ls_l_file(struct list_dir_struct *ls, char *name, ino_t ino) retval = ext2fs_read_inode(current_fs, ino, &inode); if (retval) { - fprintf(ls->f, "%5d --- error --- %s\n", name); + fprintf(ls->f, "%5ld --- error --- %s\n", retval, name); return; } modtime = inode.i_mtime; @@ -51,7 +51,7 @@ static void ls_l_file(struct list_dir_struct *ls, char *name, ino_t ino) sprintf(datestr, "%2d-%s-%2d %02d:%02d", tm_p->tm_mday, monstr[tm_p->tm_mon], tm_p->tm_year, tm_p->tm_hour, tm_p->tm_min); - fprintf(ls->f, "%6d %6o %5d %5d %5d %s %s\n", ino, inode.i_mode, + fprintf(ls->f, "%6ld %6o %5d %5d %5d %s %s\n", ino, inode.i_mode, inode.i_uid, inode.i_gid, inode.i_size, datestr, name); } @@ -61,7 +61,7 @@ static void ls_file(struct list_dir_struct *ls, char *name, char tmp[EXT2_NAME_LEN + 16]; int thislen; - sprintf(tmp, "%d (%d) %s ", ino, rec_len, name); + sprintf(tmp, "%ld (%d) %s ", ino, rec_len, name); thislen = strlen(tmp); if (ls->col + thislen > 80) { @@ -80,7 +80,6 @@ static int list_dir_proc(struct ext2_dir_entry *dirent, void *private) { char name[EXT2_NAME_LEN]; - char tmp[EXT2_NAME_LEN + 16]; struct list_dir_struct *ls = (struct list_dir_struct *) private; int thislen; -- 1.8.3.1