Commit 853372706f97131b37c147538b81f85afe5ff307

Kano 2014-03-07T12:18:24

api.c - HEX32 type needs quotes

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/api.c b/api.c
index 19c5fa8..b1b4531 100644
--- a/api.c
+++ b/api.c
@@ -1190,7 +1190,13 @@ static struct api_data *print_data(struct io_data *io_data, struct api_data *roo
 				snprintf(buf, sizeof(buf), "%"PRIu32, *((uint32_t *)(root->data)));
 				break;
 			case API_HEX32:
+				if (isjson)
+					add_item_buf(item, JSON1);
 				snprintf(buf, sizeof(buf), "0x%08x", *((uint32_t *)(root->data)));
+				add_item_buf(item, buf);
+				if (isjson)
+					add_item_buf(item, JSON1);
+				done = true;
 				break;
 			case API_UINT64:
 				snprintf(buf, sizeof(buf), "%"PRIu64, *((uint64_t *)(root->data)));