提交 895b9ad3 编写于 作者: D dm8.kim

formatting README.md

上级 f790e17b
...@@ -324,7 +324,7 @@ Let's build the above JSON and print it to a string: ...@@ -324,7 +324,7 @@ Let's build the above JSON and print it to a string:
```c ```c
//create a monitor with a list of supported resolutions //create a monitor with a list of supported resolutions
//NOTE: Returns a heap allocated string, you are required to free it after use. //NOTE: Returns a heap allocated string, you are required to free it after use.
char* create_monitor(void) char *create_monitor(void)
{ {
const unsigned int resolution_numbers[3][2] = { const unsigned int resolution_numbers[3][2] = {
{1280, 720}, {1280, 720},
...@@ -434,7 +434,7 @@ char *create_monitor_with_helpers(void) ...@@ -434,7 +434,7 @@ char *create_monitor_with_helpers(void)
goto end; goto end;
} }
if(cJSON_AddNumberToObject(resolution, "height", resolution_numbers[index][1]) == NULL) if (cJSON_AddNumberToObject(resolution, "height", resolution_numbers[index][1]) == NULL)
{ {
goto end; goto end;
} }
...@@ -443,7 +443,8 @@ char *create_monitor_with_helpers(void) ...@@ -443,7 +443,8 @@ char *create_monitor_with_helpers(void)
} }
string = cJSON_Print(monitor); string = cJSON_Print(monitor);
if (string == NULL) { if (string == NULL)
{
fprintf(stderr, "Failed to print monitor.\n"); fprintf(stderr, "Failed to print monitor.\n");
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册