《Secure Coding in C and C++》读书笔记-第六章-格式化输出

在线阅读

目录:

1. Running with Scissors

2.Strings

3.Pointer Subterfuge

4.Dynamic Memory Management

5.Integer Security

6.Formatted Output

7.Concurrency

8.File I/O

9.Recommended Practices

 

 

6.Formatted Output

    

代码举例:

void usage(char* pname){

    char usageStr[1024];

    snprintf(usageStr,1024,"Usage:%s<target>'n",pname);

    printf(usageStr);

}

 

posted @ 2017-09-26 23:22  dhqcl  阅读(262)  评论(0编辑  收藏  举报