summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/scramble.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/scramble.c b/tools/scramble.c
index ca3fd3b..ed972f7 100644
--- a/tools/scramble.c
+++ b/tools/scramble.c
@@ -333,7 +333,8 @@ int main (int argc, char** argv)
return 2;
}
/* we store a 4-letter model name too, for humans */
- strcpy(modelname, &argv[1][5]);
+ strncpy(modelname, &argv[1][5],4);
+ modelname[4] = '\0'; /* to be sure we are null terminated */
chksum = modelnum; /* start checksum calcs with this */
}