chiark / gitweb /
Typo fixes to man page.
[vbig.git] / vbig.cc
diff --git a/vbig.cc b/vbig.cc
index c0f6cb6a3e4f781a4fcc138d13e7e44ec9fc7b30..a243fb7262602703b2eeed2038866778039c9f19 100644 (file)
--- a/vbig.cc
+++ b/vbig.cc
@@ -1,6 +1,7 @@
 /*
  * This file is part of vbig.
- * Copyright (C) 2011 Richard Kettlewell
+ * Copyright (C) 2011, 2013 Richard Kettlewell
+ * Copyright (C) 2013 Ian Jackson
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -52,7 +53,7 @@ static void help(void) {
   printf("vbig - create or verify a large but pseudo-random file\n"
          "\n"
          "Usage:\n"
-         "  vbig [--seed SEED] --verify|--create PATH [SIZE]\n"
+         "  vbig [OPTIONS] [--both|--verify|--create] PATH] [SIZE]\n"
          "\n"
          "Options:\n"
          "  --seed, -s        Specify random seed as string\n"
@@ -60,6 +61,7 @@ static void help(void) {
          "  --seed-length, -L Set (maximum) seed length to read from file\n"
          "  --verify, -v      Verify that PATH contains the expected contents\n"
          "  --create, -c      Create PATH with psuedo-random contents\n"
+         "  --both, -b        Do both create and verify (default)\n"
          "  --flush, -f       Flush cache\n"
          "  --entire, -e      Write until full; read until EOF\n"
          "  --progress, -p    Show progress as we go\n"
@@ -214,7 +216,7 @@ int main(int argc, char **argv) {
     else if(*end)
       fatal(0, "invalid size");
   } else if(entireopt) {
-    size = LONG_LONG_MAX;
+    size = LLONG_MAX;
   } else {
     struct stat sb;
     if(stat(path, &sb) < 0)
@@ -238,7 +240,7 @@ static void flushstdout() {
 
 static void clearprogress() {
   if (!progress) return;
-  printf(" %-10s %*s   \r", "", sizeof(long long)*4, "");
+  printf(" %-10s %*s   \r", "", (int)sizeof(long long)*4, "");
   flushstdout();
 }
 
@@ -252,7 +254,7 @@ static void showprogress(long long amount, const char *show) {
   int triples = sizeof(amount);
   char rawbuf[triples*3 + 1];
   char outbuf[triples*4 + 1];
-  snprintf(rawbuf, sizeof(rawbuf), "% *lld", sizeof(rawbuf)-1, amount);
+  snprintf(rawbuf, sizeof(rawbuf), "% *lld", (int)sizeof(rawbuf)-1, amount);
   for (int i=0; i<triples; i++) {
     outbuf[i*4] = ' ';
     memcpy(outbuf + i*4 + 1, rawbuf + i*3, 3);