Summary Files Commits Branches @commit @diff @stats
path: root / badwolf.c
diff options
context:
space:
mode:
Commit58af594c9d9cfe7070742ff09ef8528c11d65bef (patch)
Author
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2022-02-26 13:41:55 +0100
Committer
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2022-02-26 13:54:50 +0100
Files8afad723d41000fd849a4a76fec04cbecdecbfae /badwolf.c
goodwolf-58af594c9d9cfe7070742ff09ef8528c11d65bef.tar
goodwolf-58af594c9d9cfe7070742ff09ef8528c11d65bef.tar.gz
goodwolf-58af594c9d9cfe7070742ff09ef8528c11d65bef.zip
Parenteceb1437726a1fae5280ec57bb35a8065996e21d (diff)
fmt: Grab fmt_context_id for tests
1 files changed, 3 insertions, 24 deletions
-rw-r--r--badwolf.c27
diff --git a/badwolf.c b/badwolf.c
index 8578404..fabd083 100644
--- a/badwolf.c
+++ b/badwolf.c
@@ -7,6 +7,7 @@
#include "bookmarks.h"
#include "config.h"
#include "downloads.h"
+#include "fmt.h"
#include "keybindings.h"
#include "uri.h"
@@ -132,34 +133,12 @@ WebViewCb_notify__uri(WebKitWebView *webView, GParamSpec *pspec, gpointer user_d
return TRUE;
}
-static char *
-fmt_context_id(uint64_t num, char *out)
-{
- const char alpha_digits[27] = {" ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
- char buf[66] = {'\0'};
- int i, len = 0;
-
- // Get 0 = 'A' instead of 0 = '' and 1 = 'A'
- num++;
-
- buf[len++] = ' ';
- buf[len++] = ':';
- do
- {
- buf[len++] = alpha_digits[num % 26];
- } while(num /= 26);
-
- for(i = 0; len > 0; i++)
- out[i] = buf[--len];
-
- return out;
-}
-
GtkWidget *
badwolf_new_tab_box(const gchar *title, struct Client *browser)
{
(void)browser;
- char context_id_str[7] = "";
+ /* flawfinder: ignore. bound checks are done */
+ char context_id_str[BADWOLF_CTX_SIZ] = {0, 0, 0, 0, 0, 0, 0};
fmt_context_id(browser->context_id, context_id_str);