Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: xz/debug/repeat.c

Issue 2869016: Add an unpatched version of xz, XZ Utils, to /trunk/deps/third_party (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « xz/debug/memusage.c ('k') | xz/debug/sync_flush.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file repeat.c
4 /// \brief Repeats given string given times
5 ///
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.
9 //
10 // Author: Lasse Collin
11 //
12 // This file has been put into the public domain.
13 // You can do whatever you want with this file.
14 //
15 ///////////////////////////////////////////////////////////////////////////////
16
17 #include "sysdefs.h"
18 #include <stdio.h>
19
20
21 int
22 main(int argc, char **argv)
23 {
24 if (argc != 3) {
25 fprintf(stderr, "Usage: %s COUNT STRING\n", argv[0]);
26 exit(1);
27 }
28
29 unsigned long long count = strtoull(argv[1], NULL, 10);
30 const size_t size = strlen(argv[2]);
31
32 while (count-- != 0)
33 fwrite(argv[2], 1, size, stdout);
34
35 return !!(ferror(stdout) || fclose(stdout));
36 }
OLDNEW
« no previous file with comments | « xz/debug/memusage.c ('k') | xz/debug/sync_flush.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698