aboutsummaryrefslogtreecommitdiff
path: root/libbb/compare_string_array.c
diff options
context:
space:
mode:
author"Vladimir N. Oleynik" <dzo@simtreas.ru>2005-11-26 10:45:26 +0000
committer"Vladimir N. Oleynik" <dzo@simtreas.ru>2005-11-26 10:45:26 +0000
commitcc34344d91cea789edde507bf85714af11daea71 (patch)
tree88ad65a7ac7c081822978ca80acc27ee4dd928ee /libbb/compare_string_array.c
parent61ff4b39738085d1b88d934f619b840fd296c8a8 (diff)
downloadbusybox-cc34344d91cea789edde507bf85714af11daea71.tar.gz
change the interface of libbb/compare_string_array (unsigned short to int), usaging for e2fsprogs/fsck
Diffstat (limited to 'libbb/compare_string_array.c')
-rw-r--r--libbb/compare_string_array.c8
1 files changed, 4 insertions, 4 deletions
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 @@
#include <string.h>
/* returns the array number of the string */
-extern unsigned short
+extern int
compare_string_array(const char * const string_array[], const char *key)
{
- unsigned short i;
+ int i;
for (i = 0; string_array[i] != 0; i++) {
if (strcmp(string_array[i], key) == 0) {
- break;
+ return i;
}
}
- return(i);
+ return -i;
}