$NetBSD: patch-aa,v 1.2 2015/12/12 04:00:30 kamil Exp $

Add casts to silence printf errors.
Do not overwrite stdin.

--- fdupes.c.orig	2013-04-20 18:02:18.000000000 +0000
+++ fdupes.c
@@ -643,7 +643,7 @@ void printmatches(file_t *files)
   while (files != NULL) {
     if (files->hasdupes) {
       if (!ISFLAG(flags, F_OMITFIRST)) {
-	if (ISFLAG(flags, F_SHOWSIZE)) printf("%lld byte%seach:\n", files->size,
+	if (ISFLAG(flags, F_SHOWSIZE)) printf("%lld byte%seach:\n", (long long)files->size,
 	 (files->size != 1) ? "s " : " ");
 	if (ISFLAG(flags, F_DSAMELINE)) escapefilename("\\ ", &files->d_name);
 	printf("%s%c", files->d_name, ISFLAG(flags, F_DSAMELINE)?' ':'\n');
@@ -796,7 +796,7 @@ void deletefiles(file_t *files, int prom
       do {
 	printf("Set %d of %d, preserve files [1 - %d, all]", 
           curgroup, groups, counter);
-	if (ISFLAG(flags, F_SHOWSIZE)) printf(" (%lld byte%seach)", files->size,
+	if (ISFLAG(flags, F_SHOWSIZE)) printf(" (%lld byte%seach)", (long long)files->size,
 	  (files->size != 1) ? "s " : " ");
 	printf(": ");
 	fflush(stdout);
@@ -1164,8 +1164,9 @@ int main(int argc, char **argv) {
     }
     else
     {
-      stdin = freopen("/dev/tty", "r", stdin);
-      deletefiles(files, 1, stdin);
+      FILE* fd;
+      fd = freopen("/dev/tty", "r", stdin);
+      deletefiles(files, 1, fd);
     }
   }
 
