代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/procinfo 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
--- procinfo-18/procinfo.c.ranges 2005-10-12 12:07:20.000000000 +0200
+++ procinfo-18/procinfo.c 2005-10-12 12:09:17.000000000 +0200
@@ -231,8 +231,8 @@
fseek (loadavgfp, 0L, SEEK_SET);
fgets (line, sizeof (line), loadavgfp);
- strcpy (loadavg, line);
- loadavg[strlen (loadavg) - 1] = '\0';
+ strncpy (loadavg, line, sizeof (loadavg));
+ loadavg[sizeof (loadavg) - 1] = '\0';
fgets (line, sizeof (line), loadavgfp);
printf ("Bootup: %s Load average: %s\n\n", booted, loadavg);
@@ -481,7 +481,7 @@
for (i = 0; i < nr_irqs; i++) {
if (strncmp (&line[4], irq_label[i], foo) == 0) {
- tmplen = sprintf (tmp, " [%ld]",
+ tmplen = snprintf (tmp, sizeof(tmp), " [%ld]",
atol (strtok (line, ":")));
if (strlen (irq_label[i]) > (21 - tmplen)) {
@@ -686,7 +686,7 @@
fs = strchr (line, '\t');
fs = strtok (fs + 1, "\n");
if (line[0] == 'n') {
- sprintf (tmp, "[%s]", fs);
+ snprintf (tmp, sizeof(tmp), "[%s]", fs);
printf ("%-20s", tmp);
} else
printf ("%-20s", fs);
@@ -1003,7 +1003,7 @@
if (strlen (line) > 1) {
tmpsl = atof (line);
sl = (long) (tmpsl * 1000000.0);
- sprintf (line, "delay set to %f", tmpsl);
+ snprintf (line, sizeof(line), "delay set to %f", tmpsl);
message = line;
}
redrawn = 1;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。