exhibits itself, outfile will be missing the 2nd through 1023rd
characters. */
-#include <ansidecl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
static char buf[8192];
int
-DEFUN_VOID(main)
+main (void)
{
FILE *in;
FILE *out;
- static char inname[] = "/tmp/bug5.in";
- static char outname[] = "/tmp/bug5.out";
- int i;
+ static char inname[] = OBJPFX "bug5test.in";
+ static char outname[] = OBJPFX "bug5test.out";
+ char *printbuf;
+ size_t i;
+ int result;
/* Create a test file. */
in = fopen (inname, "w+");
return 1;
}
for (i = 0; i < 1000; ++i)
- fprintf (in, "%d\n", i);
+ fprintf (in, "%Zu\n", i);
out = fopen (outname, "w");
if (out == NULL)
puts ("There should be no further output from this test.");
fflush (stdout);
- execlp ("cmp", "cmp", inname, outname, (char *) NULL);
- perror ("execlp: cmp");
- exit (1);
+
+ /* We must remove this entry to assure the `cmp' binary does not use
+ the perhaps incompatible new shared libraries. */
+ unsetenv ("LD_LIBRARY_PATH");
+
+ asprintf (&printbuf, "cmp %s %s", inname, outname);
+ result = system (printbuf);
+ remove (inname);
+ remove (outname);
+
+ exit ((result != 0));
}