当我运行这段代码(从教程到二进制安全性)时,我总是在 zsh shell 中得到一个“%”。这些百分号从何而来以及如何摆脱它们?
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[]) {
char buf[256];
memcpy(buf, argv[1],strlen(argv[1]));
printf("%s", buf);
}
% ./a.out 234
234%
% ./a.out 23466
23466%
% ./a.out 2
2%
Run Code Online (Sandbox Code Playgroud)