From 50b6b69fcfbe492d9bac3ed1c9d0cd7cc400a5de Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Sat, 30 Dec 2023 20:23:31 +0530 Subject: pass/add: trim gpg fingerprint --- util.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'util.c') diff --git a/util.c b/util.c index 6e6079e..14dfeaa 100644 --- a/util.c +++ b/util.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "util.h" @@ -31,3 +32,14 @@ int r_mkdir(const char *path, mode_t mode) return mkdir(path, mode); } + +void util_strtrim(char *s) +{ + char *rend; + + for (rend = s; *s; ++s) + if (!isspace(*s)) + rend = s; + + rend[1] = '\0'; +} -- cgit v1.2.3