repo.or.cz
/
haiku.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
vfs: check userland buffers before reading them.
[haiku.git]
/
src
/
tests
/
system
/
libroot
/
posix
/
tst-wcstof.c
blob
2f0c770627771b4006182800f5507173bd8c7e43
1
#define _GNU_SOURCE 1
2
#include <wchar.h>
3
#include <stdio.h>
4
#include <string.h>
5
#include <wctype.h>
6
7
8
int
9
main
(
void
)
10
{
11
int
result
=
0
;
12
char
buf
[
100
];
13
wchar_t
tmp
[
3
];
14
tmp
[
0
] =
'8'
;
15
tmp
[
1
] =
'1'
;
16
tmp
[
2
] =
0
;
17
18
snprintf
(
buf
,
100
,
"%S = %f"
,
tmp
,
wcstof
(
tmp
,
NULL
));
19
printf
(
"
\"
%s
\"
-> %s
\n
"
,
buf
,
strcmp
(
buf
,
"81 = 81.000000"
) ==
0
?
"okay"
20
:
"buggy"
);
21
result
|=
strcmp
(
buf
,
"81 = 81.000000"
) !=
0
;
22
23
return
result
;
24
}