40 lines
950 B
Diff
40 lines
950 B
Diff
|
From fde722a4036cba8d7bdf72f50e159e543e54a8c4 Mon Sep 17 00:00:00 2001
|
||
|
From: Simon Josefsson <simon@josefsson.org>
|
||
|
Date: Sun, 24 Oct 2021 18:31:48 +0200
|
||
|
Subject: [PATCH] cicd: Fix builds.
|
||
|
|
||
|
---
|
||
|
.gitlab-ci.yml | 2 +-
|
||
|
lib/src/mechtools.c | 13 ++++++-------
|
||
|
2 files changed, 7 insertions(+), 8 deletions(-)
|
||
|
|
||
|
--- a/src/mechtools.c
|
||
|
+++ b/src/mechtools.c
|
||
|
@@ -225,17 +225,16 @@ _gsasl_gs2_generate_header (bool nonstd, char cbflag,
|
||
|
void
|
||
|
_gsasl_hex_encode (const char *in, size_t inlen, char *out)
|
||
|
{
|
||
|
- size_t i;
|
||
|
- const char *p = in;
|
||
|
+ static const char trans[] = "0123456789abcdef";
|
||
|
|
||
|
- for (i = 0; i < 2 * inlen;)
|
||
|
+ while (inlen--)
|
||
|
{
|
||
|
- unsigned char c = *p++;
|
||
|
- out[i++] = "0123456789abcdef"[c >> 4];
|
||
|
- out[i++] = "0123456789abcdef"[c & 0x0f];
|
||
|
+ unsigned char c = *in++;
|
||
|
+ *out++ = trans[(c >> 4) & 0xf];
|
||
|
+ *out++ = trans[c & 0xf];
|
||
|
}
|
||
|
|
||
|
- out[i] = '\0';
|
||
|
+ *out = '\0';
|
||
|
}
|
||
|
|
||
|
static char
|
||
|
--
|
||
|
GitLab
|
||
|
|