aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--e2fsprogs/fsck.c4
-rw-r--r--include/libbb.h2
-rw-r--r--libbb/compare_string_array.c8
3 files changed, 7 insertions, 7 deletions
diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c
index ae4e3d0c8..7f7ab3eb3 100644
--- a/e2fsprogs/fsck.c
+++ b/e2fsprogs/fsck.c
@@ -1006,11 +1006,11 @@ static int ignore(struct fs_info *fs)
1006 if (!fs_match(fs, &fs_type_compiled)) return 1; 1006 if (!fs_match(fs, &fs_type_compiled)) return 1;
1007 1007
1008 /* Are we ignoring this type? */ 1008 /* Are we ignoring this type? */
1009 if(compare_string_array(ignored_types, fs->type)) 1009 if(compare_string_array(ignored_types, fs->type) >= 0)
1010 return 1; 1010 return 1;
1011 1011
1012 /* Do we really really want to check this fs? */ 1012 /* Do we really really want to check this fs? */
1013 wanted = compare_string_array(really_wanted, fs->type); 1013 wanted = compare_string_array(really_wanted, fs->type) >= 0;
1014 1014
1015 /* See if the <fsck.fs> program is available. */ 1015 /* See if the <fsck.fs> program is available. */
1016 s = find_fsck(fs->type); 1016 s = find_fsck(fs->type);
diff --git a/include/libbb.h b/include/libbb.h
index 70a9336d8..d1c6be670 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -466,7 +466,7 @@ typedef struct {
466} procps_status_t; 466} procps_status_t;
467 467
468extern procps_status_t * procps_scan(int save_user_arg0); 468extern procps_status_t * procps_scan(int save_user_arg0);
469extern unsigned short compare_string_array(const char * const string_array[], const char *key); 469extern int compare_string_array(const char * const string_array[], const char *key);
470 470
471extern int my_query_module(const char *name, int which, void **buf, size_t *bufsize, size_t *ret); 471extern int my_query_module(const char *name, int which, void **buf, size_t *bufsize, size_t *ret);
472 472
diff --git a/libbb/compare_string_array.c b/libbb/compare_string_array.c
index 8961e003e..fc077b309 100644
--- a/libbb/compare_string_array.c
+++ b/libbb/compare_string_array.c
@@ -17,16 +17,16 @@
17#include <string.h> 17#include <string.h>
18 18
19/* returns the array number of the string */ 19/* returns the array number of the string */
20extern unsigned short 20extern int
21compare_string_array(const char * const string_array[], const char *key) 21compare_string_array(const char * const string_array[], const char *key)
22{ 22{
23 unsigned short i; 23 int i;
24 24
25 for (i = 0; string_array[i] != 0; i++) { 25 for (i = 0; string_array[i] != 0; i++) {
26 if (strcmp(string_array[i], key) == 0) { 26 if (strcmp(string_array[i], key) == 0) {
27 break; 27 return i;
28 } 28 }
29 } 29 }
30 return(i); 30 return -i;
31} 31}
32 32