From 1f77a03fa02b0cdbaa878cd7015838638eedc4a8 Mon Sep 17 00:00:00 2001 From: Jan Breuer <jan.breuer@jaybee.cz> Date: 周日, 24 4月 2016 22:11:15 +0800 Subject: [PATCH] Fix strndup of NULL, add auto length for SCPI_ErrorPushEx --- libscpi/test/test_parser.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libscpi/test/test_parser.c b/libscpi/test/test_parser.c index bc11f74..5d64527 100644 --- a/libscpi/test/test_parser.c +++ b/libscpi/test/test_parser.c @@ -186,6 +186,9 @@ #define SCPI_ERROR_QUEUE_SIZE 4 static scpi_error_t scpi_error_queue_data[SCPI_ERROR_QUEUE_SIZE]; +#define SCPI_ERROR_INFO_HEAP_SIZE 100 +static char error_info_heap[SCPI_ERROR_INFO_HEAP_SIZE]; + static int init_suite(void) { SCPI_Init(&scpi_context, scpi_commands, @@ -193,8 +196,11 @@ scpi_units_def, "MA", "IN", NULL, "VER", scpi_input_buffer, SCPI_INPUT_BUFFER_LENGTH, - scpi_error_queue_data, SCPI_ERROR_QUEUE_SIZE, - NULL, 0); + scpi_error_queue_data, SCPI_ERROR_QUEUE_SIZE); +#if USE_DEVICE_DEPENDENT_ERROR_INFORMATION && !USE_MEMORY_ALLOCATION_FREE + SCPI_InitHeap(&scpi_context, + error_info_heap, SCPI_ERROR_INFO_HEAP_SIZE); +#endif return 0; } -- Gitblit v1.9.1