aboutsummaryrefslogtreecommitdiffstats
path: root/shared.c
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2016-02-26 10:35:57 +0100
committerlookshe <github@lookshe.org>2016-02-26 10:35:57 +0100
commit1c1f2a00d290598f050cb77ad4c846902a135f5b (patch)
treeeade990c622ab4992f2ab49d6a70ce71e1a4d63e /shared.c
parent335423fb9ded67f3820f34793a7774d9f35d7c09 (diff)
implementation to link FS#[0-9]+ to flyspray (FS#141)
Diffstat (limited to 'shared.c')
-rw-r--r--shared.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/shared.c b/shared.c
index a078a27..b65e801 100644
--- a/shared.c
+++ b/shared.c
@@ -600,3 +600,11 @@ char *get_mimetype_for_filename(const char *filename)
fclose(file);
return NULL;
}
+
+char* sub_str(const char* text, int begin, int end)
+{
+ char* sub = (char*) malloc(sizeof(char) * ((end - begin) + 1));
+ strncpy(sub, text + begin, end - begin);
+ sub[end - begin] = '\0';
+ return sub;
+}