commit
457be31b6f
@ -24,7 +24,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
// Automatically enable/disable ENABLE_DEBUG based on CBOR_NO_PRINT
|
/* Automatically enable/disable ENABLE_DEBUG based on CBOR_NO_PRINT */
|
||||||
#ifndef CBOR_NO_PRINT
|
#ifndef CBOR_NO_PRINT
|
||||||
#define ENABLE_DEBUG 1
|
#define ENABLE_DEBUG 1
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
@ -933,8 +933,8 @@ static size_t cbor_stream_decode_at(cbor_stream_t *stream, size_t offset, int in
|
|||||||
unsigned char tag = CBOR_ADDITIONAL_INFO(stream, offset);
|
unsigned char tag = CBOR_ADDITIONAL_INFO(stream, offset);
|
||||||
|
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
// Non-native builds likely don't have support for ctime (hence disable it there)
|
/* Non-native builds likely don't have support for ctime (hence disable it there)
|
||||||
// TODO: Better check for availability of ctime functions?
|
* TODO: Better check for availability of ctime functions? */
|
||||||
#ifndef CBOR_NO_CTIME
|
#ifndef CBOR_NO_CTIME
|
||||||
case CBOR_DATETIME_STRING_FOLLOWS: {
|
case CBOR_DATETIME_STRING_FOLLOWS: {
|
||||||
char buf[64];
|
char buf[64];
|
||||||
@ -978,8 +978,8 @@ static size_t cbor_stream_decode_at(cbor_stream_t *stream, size_t offset, int in
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we end up here, we weren't able to parse the current byte
|
/* if we end up here, we weren't able to parse the current byte
|
||||||
// let's just skip this (and the next one as well if required)
|
* let's just skip this (and the next one as well if required) */
|
||||||
return cbor_stream_decode_skip(stream, offset);
|
return cbor_stream_decode_skip(stream, offset);
|
||||||
|
|
||||||
#undef DESERIALIZE_AND_PRINT
|
#undef DESERIALIZE_AND_PRINT
|
||||||
|
|||||||
@ -728,7 +728,7 @@ void test_stream_decode(void)
|
|||||||
cbor_serialize_date_time_epoch(&stream, rawtime);
|
cbor_serialize_date_time_epoch(&stream, rawtime);
|
||||||
#endif /* CBOR_NO_CTIME */
|
#endif /* CBOR_NO_CTIME */
|
||||||
|
|
||||||
// decoder should skip the tag and print 'unsupported' here
|
/* decoder should skip the tag and print 'unsupported' here */
|
||||||
cbor_write_tag(&stream, 2);
|
cbor_write_tag(&stream, 2);
|
||||||
cbor_serialize_byte_string(&stream, "1");
|
cbor_serialize_byte_string(&stream, "1");
|
||||||
#endif /* CBOR_NO_SEMANTIC_TAGGING */
|
#endif /* CBOR_NO_SEMANTIC_TAGGING */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user