一种防范措施是使用 snprintf() ,它将字符串截断为您提供的最大长度。 char *x = malloc(5 * sizeof(char)); int size = snprintf(x, 5, "%s%s%s", "12", "34", ...
確定! 回上一頁