diff --git a/sys/cbor/cbor.c b/sys/cbor/cbor.c index ae230fbfff..ed6bd331b1 100644 --- a/sys/cbor/cbor.c +++ b/sys/cbor/cbor.c @@ -81,6 +81,9 @@ /* Extra defines not related to the protocol itself */ #define CBOR_STREAM_PRINT_BUFFERSIZE 1024 /* bytes */ +/* Array size */ +#define MAX_TIMESTRING_LENGTH (21) + #ifndef INFINITY #define INFINITY (1.0/0.0) #endif @@ -694,7 +697,6 @@ size_t cbor_deserialize_date_time(const cbor_stream_t *stream, size_t offset, st size_t cbor_serialize_date_time(cbor_stream_t *stream, struct tm *val) { - static const int MAX_TIMESTRING_LENGTH = 21; CBOR_ENSURE_SIZE(stream, MAX_TIMESTRING_LENGTH + 1); /* + 1 tag byte */ char time_str[MAX_TIMESTRING_LENGTH];