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 // Author: Lasse Collin
12 // This file has been put into the public domain.
13 // You can do whatever you want with this file.
15 ///////////////////////////////////////////////////////////////////////////////
22 main(int argc
, char **argv
)
25 fprintf(stderr
, "Usage: %s COUNT STRING\n", argv
[0]);
29 unsigned long long count
= strtoull(argv
[1], NULL
, 10);
30 const size_t size
= strlen(argv
[2]);
33 fwrite(argv
[2], 1, size
, stdout
);
35 return !!(ferror(stdout
) || fclose(stdout
));