summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/tools.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdk-stage1/tools.c')
-rw-r--r--mdk-stage1/tools.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/mdk-stage1/tools.c b/mdk-stage1/tools.c
index 9d0f083f6..cd1b40fe8 100644
--- a/mdk-stage1/tools.c
+++ b/mdk-stage1/tools.c
@@ -408,3 +408,16 @@ char ** list_directory(char * direct)
tmp[i] = NULL;
return memdup(tmp, sizeof(char*) * (i+1));
}
+
+
+int string_array_length(char ** a)
+{
+ int i = 0;
+ if (!a)
+ return -1;
+ while (a && *a) {
+ a++;
+ i++;
+ }
+ return i;
+}