Skip to content
This repository has been archived by the owner on Feb 17, 2022. It is now read-only.

Commit

Permalink
Merge pull request #20 from schibsted/gcc-10-go1.16
Browse files Browse the repository at this point in the history
Fixes for gcc 10 and Go 1.16.
  • Loading branch information
perj authored Feb 9, 2021
2 parents 081dab2 + d58e197 commit ed1bb6f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion core/lib/unicode.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ utf8_decode(char *dst, int *dstlen, const char *str, int slen, UConverter *utf8_
size_t strlen_utf8(const char *str) {
size_t n = 0, i;
size_t ln = strlen(str);
for (i = 0 ; i < ln ; (U8_FWD_1(str, i, ln)) ) {
for (i = 0 ; i < ln ; ) {
n++;
U8_FWD_1(str, i, ln);
}
return n;
}
2 changes: 1 addition & 1 deletion plog/bin/plogger/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

const char *appname;
const char *type;
const bool json;
bool json;

POPT_STRING("appname", NULL, &appname, "Appname to use. Defaults to the current user.");
POPT_STRING("type", NULL, &type, "Message type to use. Defaults to log.");
Expand Down
2 changes: 2 additions & 0 deletions plog/plugins/elasticsearch/output_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ func (w *OutputWriter) WriteMessage(ctx context.Context, message plogd.LogMessag
req.Type("_doc")
}
req.Doc(w.message(ctx, &message))
// Force source generation here to copy all needed data.
req.Source()

w.bulker.Add(req)
}
Expand Down
5 changes: 3 additions & 2 deletions util/lib/aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ generate_iv(unsigned char *dst, const char *src) {
gettimeofday(&tv, NULL);
snprintf((char*)dst, AES_BLOCK_SIZE, "%lx%lx", (long)tv.tv_sec, (long)tv.tv_usec);
} else {
/* This is supposed to be strncpy */
strncpy((char*) dst, src, AES_BLOCK_SIZE);
/* Could use strncpy here but newer glibc complains since it thinks it's unsafe. */
memset(dst, 0, AES_BLOCK_SIZE);
memcpy(dst, src, strnlen(src, AES_BLOCK_SIZE));
}
}

Expand Down

0 comments on commit ed1bb6f

Please sign in to comment.