stream = open_memstream (&bp, &size);
fprintf (stream, "hello");
fflush (stream);
- printf ("buf = %s, size = %d\n", bp, size);
+ printf ("buf = %s, size = %Zu\n", bp, size);
lose |= size != 5;
lose |= strncmp (bp, "hello", size);
fprintf (stream, ", world");
fclose (stream);
- printf ("buf = %s, size = %d\n", bp, size);
+ printf ("buf = %s, size = %Zu\n", bp, size);
lose |= size != 12;
lose |= strncmp (bp, "hello, world", 12);
return 1;
}
for (i = 0; i < 1000; ++i)
- fprintf (in, "%u\n", i);
+ fprintf (in, "%Zu\n", i);
out = fopen (outname, "w");
if (out == NULL)
-/* Copyright (C) 1991, 1992, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
int c = getc (f);
if (c == EOF)
{
- printf ("EOF at %u.\n", i);
+ printf ("EOF at %Zu.\n", i);
lose = 1;
break;
}
else if (c != hello[i])
{
- printf ("Got '%c' instead of '%c' at %u.\n",
+ printf ("Got '%c' instead of '%c' at %Zu.\n",
(unsigned char) c, hello[i], i);
lose = 1;
break;
for (i = replace_from; i < replace_to; ++i)
if (putc(replace[i], f) == EOF)
{
- printf ("putc('%c') got %s at %u.\n",
+ printf ("putc('%c') got %s at %Zu.\n",
replace[i], strerror (errno), i);
lose = 1;
break;
}
else
{
- printf ("ftell returns %lu; should be %u.\n", where, replace_from);
+ printf ("ftell returns %lu; should be %Zu.\n", where, replace_from);
lose = 1;
}
}
-/* Copyright (C) 1992, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
while ((len = getline (&buf, &size, stdin)) != -1)
{
- printf ("bufsize %u; read %d: ", size, len);
+ printf ("bufsize %Zu; read %Zd: ", size, len);
if (fwrite (buf, len, 1, stdout) != 1)
{
perror ("fwrite");