From: Theodore Ts'o Date: Wed, 22 Dec 2004 01:40:08 +0000 (-0500) Subject: tune2fs.c (parse_time): Fix minor buglet; the parse_time routine X-Git-Tag: E2FSPROGS-1_36~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=690e693cafa83eadbf7ce80291f53a7e89e9c2cc;p=thirdparty%2Fe2fsprogs.git tune2fs.c (parse_time): Fix minor buglet; the parse_time routine should use the passed-in argument, not optarg, even though the two are the same in the case of the current caller of said function. (i.e., no user-visible problems were caused by this, even though the code was wrong). --- diff --git a/misc/ChangeLog b/misc/ChangeLog index e0caf5f9c..979752965 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,10 @@ +2004-12-21 Theodore Ts'o + + * tune2fs.c (parse_time): Fix minor buglet; the parse_time routine + should use the passed-in argument, not optarg, even though + the two are the same in the case of the current caller of + said function. + 2004-12-15 Theodore Ts'o * mke2fs.c: Applied resize inode patch from Andreas Dilger to add diff --git a/misc/tune2fs.c b/misc/tune2fs.c index 2a8ac02c0..c300f27c5 100644 --- a/misc/tune2fs.c +++ b/misc/tune2fs.c @@ -476,9 +476,9 @@ static time_t parse_time(char *str) } memset(&ts, 0, sizeof(ts)); #ifdef HAVE_STRPTIME - strptime(optarg, "%Y%m%d%H%M%S", &ts); + strptime(str, "%Y%m%d%H%M%S", &ts); #else - sscanf(optarg, "%4d%2d%2d%2d%2d%2d", &ts.tm_year, &ts.tm_mon, + sscanf(str, "%4d%2d%2d%2d%2d%2d", &ts.tm_year, &ts.tm_mon, &ts.tm_mday, &ts.tm_hour, &ts.tm_min, &ts.tm_sec); ts.tm_year -= 1900; ts.tm_mon -= 1;