From e322621698d4700fad670670634fd4e0b7629d74 Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Sat, 23 Mar 2024 17:54:15 -0300 Subject: tweak usage of str replacement code --- plugins/libre_redirect/libre_redirect.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'plugins/libre_redirect') diff --git a/plugins/libre_redirect/libre_redirect.c b/plugins/libre_redirect/libre_redirect.c index a4fabdf..55ddb84 100644 --- a/plugins/libre_redirect/libre_redirect.c +++ b/plugins/libre_redirect/libre_redirect.c @@ -6,15 +6,13 @@ #define LIBRE_N 50 /* Inspired by https://libredirect.github.io/, but in C. */ - -// Use string manipulation over urls int libre_redirect(const char* uri, char* output) { int len_uri = strlen(uri); int len_output = strlen(output); if ((len_output - len_uri) < LIBRE_N) { - printf("Not enough memory\n"); + fprintf(stderr, "Not enough memory\n"); return 1; // not enough memory. } else { char* annoying_sites[] = { @@ -52,14 +50,14 @@ int libre_redirect(const char* uri, char* output) case 0: // no match found break; case 1: // str_replace_start somehow failed - printf("str_replace_start failed\n"); + fprintf(stderr, "str_replace_start failed\n"); return 1; break; case 2: // match succeeded return 2; break; default: - printf("Unreachable state"); + fprintf(stderr, "Unreachable state\n"); } } strcpy(output, uri); -- cgit v1.2.3