Whamcloud - gitweb
e2freefrag: Fix getopt bug on machines with unsigned chars
authorMike Frysinger <vapier@gentoo.org>
Tue, 5 Jan 2010 04:15:32 +0000 (23:15 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 30 Apr 2011 16:05:36 +0000 (16:05 +0000)
commit87958289c17b15cd45c25e05c1e82654d9cbb737
tree2999a7dc0078548556fc69c480db1a331e76f733
parent0fb2d1d34660d2d87d2cbf4c81e3715a60ffb11c
e2freefrag: Fix getopt bug on machines with unsigned chars

The getopt() function returns an int, not a char.  On systems where the
default char is unsigned (like ppc), we get weird behavior where -1 is
truncated to 0xff but compared to (int)-1.

Also fix this same bug for two test programs, test_rel and iscan,
which aren't currently used at the moment.

Addresses-Gentoo-Bug: #299386

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/iscan.c
misc/e2freefrag.c
tests/progs/test_rel.c