aboutsummaryrefslogtreecommitdiffstats
path: root/tests/progs/test_rel.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-01-04 23:15:32 -0500
committerTheodore Ts'o <tytso@mit.edu>2010-07-05 14:53:58 -0400
commitb887f08f959fa3ef4ead9b6e2fd71becf4877a40 (patch)
treed941568123102dad85b1ffb32127eaf5b4d4ba8b /tests/progs/test_rel.c
parentf96cb89e7aa1ff0d2c4f90b2cf499151f96f10c4 (diff)
downloadandroid_external_e2fsprogs-b887f08f959fa3ef4ead9b6e2fd71becf4877a40.tar.gz
android_external_e2fsprogs-b887f08f959fa3ef4ead9b6e2fd71becf4877a40.tar.bz2
android_external_e2fsprogs-b887f08f959fa3ef4ead9b6e2fd71becf4877a40.zip
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>
Diffstat (limited to 'tests/progs/test_rel.c')
-rw-r--r--tests/progs/test_rel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/progs/test_rel.c b/tests/progs/test_rel.c
index e6997b65..954a7221 100644
--- a/tests/progs/test_rel.c
+++ b/tests/progs/test_rel.c
@@ -713,7 +713,7 @@ void main(int argc, char **argv)
int retval;
int sci_idx;
const char *usage = "Usage: test_rel [-R request] [-f cmd_file]";
- char c;
+ int c;
char *request = 0;
int exit_status = 0;
char *cmd_file = 0;