This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository terminology.
View the commit online.
commit 3b0384f063840507ebbce10bcb0c020bac2b0c6a
Author: Boris Faure <bill...@gmail.com>
AuthorDate: Sun Aug 20 16:00:21 2023 +0200
utils: the needed api is to decode
---
src/bin/utils.c | 30 +++++++++++++++---------------
src/bin/utils.h | 2 +-
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/src/bin/utils.c b/src/bin/utils.c
index 3b58c2d..bfaa305 100644
--- a/src/bin/utils.c
+++ b/src/bin/utils.c
@@ -78,7 +78,7 @@ end:
}
char *
-ty_eina_unicode_base64_encode(Eina_Unicode *unicode)
+ty_eina_unicode_base64_decode(Eina_Unicode *unicode)
{
int utf8_len = 0;
Eina_Binbuf *bb;
@@ -89,20 +89,20 @@ ty_eina_unicode_base64_encode(Eina_Unicode *unicode)
src = "" &utf8_len);
if (!src)
return NULL;
- bb = eina_binbuf_manage_new((const unsigned char*)src, utf8_len, EINA_FALSE);
- if (!bb)
+ sb = eina_strbuf_manage_new_length(src, utf8_len);
+ if (!sb)
{
free(src);
return NULL;
}
- sb = emile_base64_encode(bb);
- eina_binbuf_free(bb);
- if (!sb)
+ bb = emile_base64_decode(sb);
+ eina_strbuf_free(sb);
+ if (!bb)
return NULL;
- res = (char*) eina_strbuf_string_steal(sb);
- eina_strbuf_free(sb);
+ res = (char*) eina_binbuf_string_steal(bb);
+ eina_binbuf_free(bb);
return res;
}
@@ -114,23 +114,23 @@ int tytest_base64(void)
const char *expected;
- const char *terminology = "Terminology rox!";
- src = "" NULL);
+ const char *terminology_rox = "VGVybWlub2xvZ3kgcm94IQ==";
+ src = "" NULL);
assert(src);
- res = ty_eina_unicode_base64_encode(src);
+ res = ty_eina_unicode_base64_decode(src);
assert(res);
- expected = "VGVybWlub2xvZ3kgcm94IQ==";
+ expected = "Terminology rox!";
assert(memcmp(res, expected, strlen(expected)) == 0);
free(src);
free(res);
- const char *hearts = "♥♡👍🚲✿ ❀ ❁🙌";
+ const char *hearts = "4pml4pmh8J+RjfCfmrLinL8g4p2AIOKdgfCfmYw=";
src = "" NULL);
assert(src);
- res = ty_eina_unicode_base64_encode(src);
+ res = ty_eina_unicode_base64_decode(src);
assert(res);
- expected = "4pml4pmh8J+RjfCfmrLinL8g4p2AIOKdgfCfmYw=";
+ expected = "♥♡👍🚲✿ ❀ ❁🙌";
assert(memcmp(res, expected, strlen(expected)) == 0);
free(src);
free(res);
diff --git a/src/bin/utils.h b/src/bin/utils.h
index 92d7f41..1c936a0 100644
--- a/src/bin/utils.h
+++ b/src/bin/utils.h
@@ -7,5 +7,5 @@
Eina_Bool homedir_get(char *buf, size_t size);
void open_url(const Config *config, const char *url);
-char * ty_eina_unicode_base64_encode(Eina_Unicode *c);
+char * ty_eina_unicode_base64_decode(Eina_Unicode *c);
#endif
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.