summaryrefslogtreecommitdiffstats
path: root/system/snapscreenshot/errors_to_stderr.diff
blob: d769e262bd4240fc1d25a264304f7d0674edbac8 (plain)
diff -Naur snapscreenshot-1.0.14.3/argh.c snapscreenshot-1.0.14.3.patched/argh.c
--- snapscreenshot-1.0.14.3/argh.c	2009-08-31 07:23:26.000000000 -0400
+++ snapscreenshot-1.0.14.3.patched/argh.c	2018-07-04 17:48:36.194652959 -0400
@@ -13,7 +13,7 @@
     long tmp = strtol(*s, (char **)s, 10);
     if(tmp<min || tmp>max)
     {
-        printf("%s: parameter (--%s) value out of range `%ld'\n", ProgName, LastParm, tmp);
+        fprintf(stderr, "%s: parameter (--%s) value out of range `%ld'\n", ProgName, LastParm, tmp);
         exit(EXIT_FAILURE);
     }
     return tmp;
@@ -21,14 +21,14 @@
 
 void SuggestHelp(void)
 {
-    printf("\nTry `%s --help' for more information.\n", ProgName);
+    fprintf(stderr, "\nTry `%s --help' for more information.\n", ProgName);
 }
 void ArgError(int a, const char *b)
 {
     switch(a)
     {
         case 0:
-            printf("%s: illegal option -- %c", ProgName, *b);
+            fprintf(stderr, "%s: illegal option -- %c", ProgName, *b);
             for(a=0; Options[a].c; a++)
                 if(*b == Options[a].c)
                 {
@@ -37,10 +37,10 @@
                 }
             break;
         case 1:
-            printf("%s: unrecognized option `--%s'", ProgName, b);
+            fprintf(stderr, "%s: unrecognized option `--%s'", ProgName, b);
             break;
         default:
-            printf("%s: invalid parameter: `%s'\n", ProgName, b);
+            fprintf(stderr, "%s: invalid parameter: `%s'\n", ProgName, b);
     }
     SuggestHelp();
     exit(EXIT_FAILURE);