Rizin
unix-like reverse engineering framework and cli tools
repeat.c
Go to the documentation of this file.
1 //
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 //
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 }
#define NULL
Definition: cris-opc.c:27
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
Definition: sflib.h:98
voidpf void uLong size
Definition: ioapi.h:138
static static fork const void static count static fd const char const char static newpath char char argv
Definition: sflib.h:40
int main(int argc, char **argv)
Definition: repeat.c:22
Common includes, definitions, system-specific things etc.