소스 검색

example/openssl_client: Fix http string "printf" error without end character '\0'

Dong Heng 8 년 전
부모
커밋
d523a5181b
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      examples/protocols/openssl_client/main/openssl_client_example_main.c

+ 1 - 0
examples/protocols/openssl_client/main/openssl_client_example_main.c

@@ -137,6 +137,7 @@ static void openssl_example_task(void *p)
         if (ret <= 0) {
         if (ret <= 0) {
             break;
             break;
         }
         }
+        recv_buf[ret] = '\0';
         recv_bytes += ret;
         recv_bytes += ret;
         ESP_LOGI(TAG, "%s", recv_buf);
         ESP_LOGI(TAG, "%s", recv_buf);
     } while (1);
     } while (1);