aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2006-01-03 18:06:23 +0100
committerH. Peter Anvin <hpa@zytor.com>2006-01-03 12:21:53 -0800
commit040dac1752a5c3728fc4abbb2217ecd9c011aae3 (patch)
treec15141dd543dca18d2e39c97fa4c62f729e1dc5c
parent49ab561194c19b980850c8f46973b317ea6e4857 (diff)
downloadklibc-040dac1752a5c3728fc4abbb2217ecd9c011aae3.tar.gz
Fix fstype crashklibc-1.1.15
fstype is currently broken in klibc (1.1.14 and git). It segfaults on startup when not invoked with an argument. Attached patch fixes that. PS: The previously reported problems with klibc 1.1.8 don't occur anymore, thanks. Regards, Jürg -- Jürg Billeter <j@bitron.ch>
-rw-r--r--utils/fstype.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/fstype.c b/utils/fstype.c
index e9cdf285838f8..549e1e010c386 100644
--- a/utils/fstype.c
+++ b/utils/fstype.c
@@ -225,12 +225,12 @@ int main(int argc, char *argv[])
progname = argv[0];
- if (argc >= 2) {
+ if (argc > 2) {
fprintf(stderr, "Usage: %s [file]\n", progname);
return 1;
}
- if (argc >= 1 && strcmp(argv[1], "-")) {
+ if (argc > 1 && strcmp(argv[1], "-")) {
fd = open(argv[1], O_RDONLY);
if ( fd < 0 ) {
perror(argv[1]);