From e5b3b27966ac71ca8b445a18a6ee1238684fb3f4 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 1 Apr 2002 15:42:21 -0500 Subject: [PATCH] util.c (parse_ulong): Fix typo which cases parse_ulong to coredump if the err variable is filled in (for example, if the -b or -s options are passed to the debugfs's command-line invocation). --- debugfs/ChangeLog | 7 +++++++ debugfs/util.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debugfs/ChangeLog b/debugfs/ChangeLog index cde9e6d9..2317403d 100644 --- a/debugfs/ChangeLog +++ b/debugfs/ChangeLog @@ -1,3 +1,10 @@ +2002-04-01 + + * util.c (parse_ulong): Fix typo which cases parse_ulong to + coredump if the err variable is filled in (for example, if + the -b or -s options are passed to the debugfs's + command-line invocation). + 2002-03-11 Theodore Tso * ls.c (list_dir_proc): Fix bug: ls -l fails to print the file diff --git a/debugfs/util.c b/debugfs/util.c index fa13da47..1a169c12 100644 --- a/debugfs/util.c +++ b/debugfs/util.c @@ -146,12 +146,12 @@ unsigned long parse_ulong(const char *str, const char *cmd, ret = strtoul(str, &tmp, 0); if (*tmp == 0) { - if (*err) + if (err) *err = 0; return ret; } com_err(cmd, 0, "Bad %s - %s", descr, str); - if (*err) + if (err) *err = 1; else exit(1);