about summary refs log tree commit diff stats
path: root/src/pgp/gpg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pgp/gpg.c')
-rw-r--r--src/pgp/gpg.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/pgp/gpg.c b/src/pgp/gpg.c
index 8d075cd9..cda77e13 100644
--- a/src/pgp/gpg.c
+++ b/src/pgp/gpg.c
@@ -671,6 +671,29 @@ p_gpg_autocomplete_key_reset(void)
     autocomplete_reset(key_ac);
 }
 
+char *
+p_gpg_format_fp_str(char *fp)
+{
+    if (!fp) {
+        return NULL;
+    }
+
+    GString *format = g_string_new("");
+    int i;
+    int len = strlen(fp);
+    for (i = 0; i < len; i++) {
+        g_string_append_c(format, fp[i]);
+        if (((i+1) % 4 == 0) && (i+1 < len)) {
+            g_string_append_c(format, ' ');
+        }
+    }
+
+    char *result = format->str;
+    g_string_free(format, FALSE);
+
+    return result;
+}
+
 static char*
 _remove_header_footer(char *str, const char * const footer)
 {