X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fwritemany.c;h=72d1ac6a71a7f37da696087ffef52989d46d7ed9;hb=a2ba6c0c6e7b22ae31280253cd916fa3e29bd749;hp=707ab8d4bacf74e018bebb66e62162909bffc9e3;hpb=8faf82a6b002ecab7eaf4c6a0ccfaa72ecdd0154;p=fs%2Flustre-release.git diff --git a/lustre/tests/writemany.c b/lustre/tests/writemany.c index 707ab8d..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. @@ -26,7 +24,7 @@ * GPL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. */ /* @@ -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 */