开发者

A complete list of unsafe string handling functions and their safer replacements for linux

开发者 https://www.devze.com 2023-03-21 15:28 出处:网络
I am looking开发者_Python百科 for something like that: strcpy -> strncpy sprintf -> snprintf etc Google does not know I a\'m afraid. Do you?

I am looking开发者_Python百科 for something like that:

strcpy -> strncpy

sprintf -> snprintf

etc

Google does not know I a'm afraid. Do you?


  • strcpy -> strncpy -> strlcpy/strcpy_s
  • strcat -> strncat -> strlcat/strcat_s
  • strtok
  • sprintf -> snprintf
  • vsprintf -> vsnprintf
  • gets -> fgets/gets_s
  • makepath -> _makepath_s (MSDN)
  • _splitpath -> _splitpath_s (MSDN)
  • scanf/sscanf -> sscanf_s (MSDN)
  • snscanf -> _snscanf_s (MSDN)
  • strlen -> strnlen_s (MSDN) / strnlen

MSDN has a article covering banned functions: http://msdn.microsoft.com/en-us/library/bb288454.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消