Fix fstype crash
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>
diff --git a/utils/fstype.c b/utils/fstype.c
index e9cdf28..549e1e0 100644
--- a/utils/fstype.c
+++ b/utils/fstype.c
@@ -225,12 +225,12 @@
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]);