forked from projectacrn/acrn-hypervisor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HV: rewrite strncpy_s to be iso c11 compliant
Per C11 standard (ISO/IEC 9899:2011): K.3.7.1.4 1. Copying shall not take place between objects that overlap; 2. If there is a runtime-constraint violation, the strncpy_s function sets s1[0] to '\0\; 3. The strncpy_s function returns zero if there was no runtime-constraint violation. Otherwise, a nonzero value is returned. 4. The function is implemented with memcpy_s() because the runtime-constraint detection is almost same. Tracked-On: projectacrn#4885 Signed-off-by: Victor Sun <victor.sun@intel.com> Reviewed-by: Yonghua Huang <yonghua.huang@intel.com> Reviewed-by: Yin Fengwei <fengwei.yin@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
- Loading branch information
1 parent
e254be1
commit bad1203
Showing
2 changed files
with
20 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters