repo.or.cz
/
minix3.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Uninitialized vector entry?
[minix3.git]
/
lib
/
stdio
/
fwrite.c
blob
f1a04452e78e0ea7ff02507b747ef4d3f7962b37
1
/*
2
* fwrite.c - write a number of array elements on a file
3
*/
4
/* $Header$ */
5
6
#include <stdio.h>
7
8
size_t
9
fwrite
(
const void
*
ptr
,
size_t
size
,
size_t
nmemb
,
10
register
FILE
*
stream
)
11
{
12
register
const unsigned char
*
cp
=
ptr
;
13
register
size_t
s
;
14
size_t
ndone
=
0
;
15
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
++;
24
}
25
while
(--
s
);
26
ndone
++;
27
}
28
return
ndone
;
29
}