summaryrefslogtreecommitdiff
path: root/sys/arch/mvmeppc/dev/cpu.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-05-11 19:41:13 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-05-11 19:41:13 +0000
commitd6d7c738346239a3c708dc0978911e106ff464ef (patch)
treebc43e8e3f9316ebb64d8b2b82353eeccf749cf26 /sys/arch/mvmeppc/dev/cpu.c
parent0b07ddfee5e2e357a1085b59936307292adeacfe (diff)
string cleaning; krw ok
Diffstat (limited to 'sys/arch/mvmeppc/dev/cpu.c')
-rw-r--r--sys/arch/mvmeppc/dev/cpu.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/sys/arch/mvmeppc/dev/cpu.c b/sys/arch/mvmeppc/dev/cpu.c
index 468c7c84a19..9e41aafbb8d 100644
--- a/sys/arch/mvmeppc/dev/cpu.c
+++ b/sys/arch/mvmeppc/dev/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.5 2003/02/11 19:20:26 mickey Exp $ */
+/* $OpenBSD: cpu.c,v 1.6 2003/05/11 19:41:11 deraadt Exp $ */
/*
* Copyright (c) 1997 Per Fogelstrom
@@ -89,40 +89,42 @@ cpuattach(parent, dev, aux)
cpu = pvr >> 16;
switch (cpu) {
case 1:
- sprintf(cpu_model, "601");
+ snprintf(cpu_model, sizeof cpu_model, "601");
break;
case 3:
- sprintf(cpu_model, "603");
+ snprintf(cpu_model, sizeof cpu_model, "603");
break;
case 4:
- sprintf(cpu_model, "604");
+ snprintf(cpu_model, sizeof cpu_model, "604");
break;
case 5:
- sprintf(cpu_model, "602");
+ snprintf(cpu_model, sizeof cpu_model, "602");
break;
case 6:
- sprintf(cpu_model, "603e");
+ snprintf(cpu_model, sizeof cpu_model, "603e");
break;
case 7:
- sprintf(cpu_model, "603ev");
+ snprintf(cpu_model, sizeof cpu_model, "603ev");
break;
case 8:
- sprintf(cpu_model, "750");
+ snprintf(cpu_model, sizeof cpu_model, "750");
break;
case 9:
- sprintf(cpu_model, "604ev");
+ snprintf(cpu_model, sizeof cpu_model, "604ev");
break;
case 12:
- sprintf(cpu_model, "7400(G4)");
+ snprintf(cpu_model, sizeof cpu_model, "7400(G4)");
break;
case 20:
- sprintf(cpu_model, "620");
+ snprintf(cpu_model, sizeof cpu_model, "620");
break;
default:
- sprintf(cpu_model, "Version %x", cpu);
+ snprintf(cpu_model, sizeof cpu_model, "Version %x", cpu);
break;
}
- sprintf(cpu_model + strlen(cpu_model), " (Revision %x)", pvr & 0xffff);
+ snprintf(cpu_model + strlen(cpu_model),
+ sizeof cpu_model - strlen(cpu_model),
+ " (Revision %x)", pvr & 0xffff);
printf(": %s", cpu_model);
/* This should only be executed on openfirmware systems... */