Uninitialized vector entry?
[minix3.git] / lib / stdio / fwrite.c
blobf1a04452e78e0ea7ff02507b747ef4d3f7962b37
1 /*
2 * fwrite.c - write a number of array elements on a file
3 */
4 /* $Header$ */
6 #include <stdio.h>
8 size_t
9 fwrite(const void *ptr, size_t size, size_t nmemb,
10 register FILE *stream)
12 register const unsigned char *cp = ptr;
13 register size_t s;
14 size_t ndone = 0;
16 if (size)
17 while ( ndone < nmemb ) {
18 s = size;
19 do {
20 if (putc((int)*cp, stream)
21 == EOF)
22 return ndone;
23 cp++;
25 while (--s);
26 ndone++;
28 return ndone;