Skip to content

Commit 30fd485

Browse files
committed
change cast size_t to unsigned long in the printf
1 parent 6db091c commit 30fd485

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: cpp
2+
compiler:
3+
- gcc
4+
- clang
5+
script: make

src/tempodb/tempodb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <netinet/in.h>
77
#include <netdb.h>
88
#include <arpa/inet.h>
9+
#include <inttypes.h>
910

1011
static char access_key[ACCESS_KEY_SIZE + 1] = {0};
1112
static char access_secret[ACCESS_KEY_SIZE + 1] = {0};
@@ -66,7 +67,7 @@ void tempodb_build_query(char *buffer, const size_t buffer_size, const char *ver
6667
snprintf(access_credentials, strlen(access_key) + strlen(access_secret) + 2, "%s:%s", access_key, access_secret);
6768
encoded_credentials = encode_base64(strlen(access_credentials), (unsigned char *)access_credentials);
6869

69-
snprintf(buffer, buffer_size, "%s %s HTTP/1.0\r\nAuthorization: Basic %s\r\nUser-Agent: tempodb-embedded-c/1.0.0\r\nHost: %s\r\nContent-Length: %ld\r\nContent-Type: application/json\r\n\r\n%s", verb, path, encoded_credentials, DOMAIN, strlen(payload), payload);
70+
snprintf(buffer, buffer_size, "%s %s HTTP/1.0\r\nAuthorization: Basic %s\r\nUser-Agent: tempodb-embedded-c/1.0.0\r\nHost: %s\r\nContent-Length: %lu\r\nContent-Type: application/json\r\n\r\n%s", verb, path, encoded_credentials, DOMAIN, (unsigned long)strlen(payload), payload);
7071
free(encoded_credentials);
7172
}
7273

0 commit comments

Comments
 (0)