1 ///////////////////////////////////////////////////////////////////////////////
4 /// \brief Repeats given string given times
6 /// This program can be useful when debugging run-length encoder in
7 /// the Subblock filter, especially the condition when repeat count
8 /// doesn't fit into 28-bit integer.
10 // Copyright (C) 2008 Lasse Collin
12 // This library is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU Lesser General Public
14 // License as published by the Free Software Foundation; either
15 // version 2.1 of the License, or (at your option) any later version.
17 // This library is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 // Lesser General Public License for more details.
22 ///////////////////////////////////////////////////////////////////////////////
29 main(int argc, char **argv)
32 fprintf(stderr, "Usage: %s COUNT STRING\n", argv[0]);
36 unsigned long long count = strtoull(argv[1], NULL, 10);
37 const size_t size = strlen(argv[2]);
40 fwrite(argv[2], 1, size, stdout);
42 return !!(ferror(stdout) || fclose(stdout));