aboutsummaryrefslogtreecommitdiff
path: root/plugins/libre_redirect
diff options
context:
space:
mode:
authorNunoSempere <nuno.sempere@protonmail.com>2023-05-13 23:50:14 -0400
committerNunoSempere <nuno.sempere@protonmail.com>2023-05-13 23:50:14 -0400
commita8be16b1ee80f5d1d89b66494ec74af999652c2a (patch)
tree58b8179e0d2721d7c62360763d2699b61df46014 /plugins/libre_redirect
parentc46e2ba3985846019d3377895e52fc360a6ce061 (diff)
debug shortcuts plugin
Diffstat (limited to 'plugins/libre_redirect')
-rw-r--r--plugins/libre_redirect/libre_redirect.c8
-rw-r--r--plugins/libre_redirect/str_init.c7
-rw-r--r--plugins/libre_redirect/str_init.h1
3 files changed, 9 insertions, 7 deletions
diff --git a/plugins/libre_redirect/libre_redirect.c b/plugins/libre_redirect/libre_redirect.c
index 134eabe..5f384d9 100644
--- a/plugins/libre_redirect/libre_redirect.c
+++ b/plugins/libre_redirect/libre_redirect.c
@@ -2,6 +2,7 @@
#include <stdio.h>
#include <string.h>
+#include "str_init.h"
#include "str_replace_start.h"
#define LIBRE_N 19
@@ -11,13 +12,6 @@
/* Inspired by https://libredirect.github.io/, but in C. */
-void str_init(char* str, int n)
-{
- for (int i = 0; i < n; i++)
- str[i] = ' ';
- str[n] = '\0';
-} // could also use <https://manpages.ubuntu.com/manpages/impish/man3/strinit.3pub.html>
-
int libre_redirect(const char* uri, char* output)
{
int l1 = strlen(uri);
diff --git a/plugins/libre_redirect/str_init.c b/plugins/libre_redirect/str_init.c
new file mode 100644
index 0000000..edbe2ab
--- /dev/null
+++ b/plugins/libre_redirect/str_init.c
@@ -0,0 +1,7 @@
+void str_init(char* str, int n)
+{
+ for (int i = 0; i < n; i++)
+ str[i] = ' ';
+ str[n] = '\0';
+} // could also use <https://manpages.ubuntu.com/manpages/impish/man3/strinit.3pub.html>
+
diff --git a/plugins/libre_redirect/str_init.h b/plugins/libre_redirect/str_init.h
new file mode 100644
index 0000000..b282b7f
--- /dev/null
+++ b/plugins/libre_redirect/str_init.h
@@ -0,0 +1 @@
+void str_init(char* str, int n);