summaryrefslogtreecommitdiff
path: root/libbb/compare_string_array.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-11-04 04:10:17 +0000
committerDenis Vlasenko2007-11-04 04:10:17 +0000
commitbfc3d82256c45fb1e6e04ca85fac8a65b34b72a1 (patch)
treeefe5bed86f389cec7e7e4f73b12b58783327e4b2 /libbb/compare_string_array.c
parent681023650e69f6e4fa959c5c6f0480d4a0edf906 (diff)
downloadbusybox-bfc3d82256c45fb1e6e04ca85fac8a65b34b72a1.zip
busybox-bfc3d82256c45fb1e6e04ca85fac8a65b34b72a1.tar.gz
ifconfig: code shrink
adjtimex: code shrink libbb: move nth_string function into libbb hdparm: nth_string was here text data bss dec hex filename 730013 10334 12032 752379 b7afb busybox_old 730093 10134 12032 752259 b7a83 busybox_unstripped
Diffstat (limited to 'libbb/compare_string_array.c')
-rw-r--r--libbb/compare_string_array.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libbb/compare_string_array.c b/libbb/compare_string_array.c
index 731d3d8..7b5ce85 100644
--- a/libbb/compare_string_array.c
+++ b/libbb/compare_string_array.c
@@ -67,3 +67,12 @@ int index_in_substrings(const char *strings, const char *key)
}
return -1;
}
+
+const char *nth_string(const char *strings, int n)
+{
+ while (n) {
+ n--;
+ strings += strlen(strings) + 1;
+ }
+ return strings;
+}