X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fwritemany.c;h=72d1ac6a71a7f37da696087ffef52989d46d7ed9;hb=d7b109d598674dcd7c654ca0fe06368d52eaeb3b;hp=1669d6c4bf892818419c4aaec37ff9cd18641514;hpb=0f8dca08a4f68cba82c2c822998ecc309d3b7aaf;p=fs%2Flustre-release.git diff --git a/lustre/tests/writemany.c b/lustre/tests/writemany.c index 1669d6c..72d1ac6 100644 --- a/lustre/tests/writemany.c +++ b/lustre/tests/writemany.c @@ -1,6 +1,4 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * +/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -190,7 +188,8 @@ int run_one_child(char *file, int thread, int seconds) break; } - sprintf(filename, "%s-%d-%ld", file, thread, nfiles); + snprintf(filename, sizeof(filename), "%s-%d-%ld", + file, thread, nfiles); fd = open(filename, O_RDWR | O_CREAT, 0666); if (fd < 0) { @@ -249,7 +248,7 @@ int main(int argc, char *argv[]) char *directory; int i = 1, rc = 0; - sprintf(cmdname, "%s", argv[0]); + snprintf(cmdname, sizeof(cmdname), "%s", argv[0]); while((i < argc) && (argv[i][0] == '-')) { switch (argv[i][1]) { @@ -293,7 +292,7 @@ int main(int argc, char *argv[]) } if (rc == 0) { /* children */ - sprintf(cmdname, "%s-%d", argv[0], i); + snprintf(cmdname, sizeof(cmdname), "%s-%d", argv[0], i); return (run_one_child(directory, i, duration)); } else { /* parent */