小编Mr.*_*ous的帖子

YAMLException:映射条目的缩进错误

在下面的 OpenAPI 定义中,参数 LayoutId 导致解析器错误“映射条目的缩进错误”。

yaml 文件:

---
name: 1x1+1x1_1x1  
  LayoutId: 3A1B6753-4F92-4DCD-A1E3-6462374EC897
  LayoutType: ControlRoomGrid
  ConfiguredSegments:
    SegmentConfiguration:
      Height: 50
      Id: None
      Left: 0
      SerializationId: true
      Top: 0
      Width: 50
      Index: 0
    SegmentConfiguration:
      Height: 50
      Id: None
      Left: 0
      SerializationId: true
      Top: 50
      Width: 50
      Index: 0
    SegmentConfiguration:
      Height: 100
      Id: None
      Left: 50
      SerializationId: true
      Top: 0
      Width: 50
      Index: 0
  IntendedResolution:
    Height:
      100
    Width:
      100
  PlaneType: A
---
Run Code Online (Sandbox Code Playgroud)

我花了将近一个小时来解决这个问题,但无法找到问题所在。

yaml node.js

7
推荐指数
1
解决办法
2万
查看次数

为什么使用_tcscpy_s而不是_tcscpy?

我是 C++ 编程新手。我正在对我的代码执行 SAST 违规检查,扫描会抛出警告:

_tcscpy(destination_array,Source);
Run Code Online (Sandbox Code Playgroud)

在 Source.cpp 文件的第 58 行中发现使用了危险函数 _tcscpy。此类功能可能会暴露信息并允许攻击者完全控制主机

因此,现在我必须使用它来使警告消失:

_tcscpy_s(destination_array,_countof(destination_array),Source);
Run Code Online (Sandbox Code Playgroud)

_tcscpy和之间的实际区别是什么?_tcscpy_s它如何使代码安全?

c++ winapi visual-c++

0
推荐指数
1
解决办法
3193
查看次数

标签 统计

c++ ×1

node.js ×1

visual-c++ ×1

winapi ×1

yaml ×1