|
4 | 4 |
|
5 | 5 | FBCALL FB_WCHAR *fb_FileWstrInput( ssize_t chars, int fnum ) |
6 | 6 | { |
7 | | - FB_FILE *handle; |
| 7 | + FB_FILE *handle; |
8 | 8 | FB_WCHAR *dst; |
9 | | - size_t len; |
10 | | - int res = FB_RTERROR_OK; |
| 9 | + size_t len; |
| 10 | + int res = FB_RTERROR_OK; |
11 | 11 |
|
12 | 12 | fb_DevScrnInit_ReadWstr( ); |
13 | 13 |
|
14 | 14 | FB_LOCK(); |
15 | 15 |
|
16 | | - handle = FB_FILE_TO_HANDLE(fnum); |
17 | | - if( !FB_HANDLE_USED(handle) ) |
18 | | - { |
| 16 | + handle = FB_FILE_TO_HANDLE(fnum); |
| 17 | + if( !FB_HANDLE_USED(handle) ) |
| 18 | + { |
19 | 19 | FB_UNLOCK(); |
20 | 20 | return NULL; |
21 | 21 | } |
22 | 22 |
|
23 | | - dst = fb_wstr_AllocTemp( chars ); |
24 | | - if( dst != NULL ) |
25 | | - { |
26 | | - ssize_t read_chars = 0; |
27 | | - if( FB_HANDLE_IS_SCREEN(handle) ) |
28 | | - { |
29 | | - while( read_chars != chars ) |
30 | | - { |
31 | | - res = fb_FileGetDataEx( handle, |
32 | | - 0, |
33 | | - (void *)&dst[read_chars], |
34 | | - chars - read_chars, |
35 | | - &len, |
36 | | - TRUE, |
37 | | - TRUE ); |
38 | | - if( res != FB_RTERROR_OK ) |
39 | | - break; |
| 23 | + dst = fb_wstr_AllocTemp( chars ); |
| 24 | + if( dst != NULL ) |
| 25 | + { |
| 26 | + ssize_t read_chars = 0; |
| 27 | + if( FB_HANDLE_IS_SCREEN(handle) ) |
| 28 | + { |
| 29 | + while( read_chars != chars ) |
| 30 | + { |
| 31 | + res = fb_FileGetDataEx( handle, |
| 32 | + 0, |
| 33 | + (void *)&dst[read_chars], |
| 34 | + chars - read_chars, |
| 35 | + &len, |
| 36 | + TRUE, |
| 37 | + TRUE ); |
| 38 | + if( res != FB_RTERROR_OK ) |
| 39 | + break; |
40 | 40 |
|
41 | | - read_chars += len; |
42 | | - } |
43 | | - } |
44 | | - else |
45 | | - { |
46 | | - res = fb_FileGetDataEx( handle, |
47 | | - 0, |
48 | | - (void *)dst, |
49 | | - chars, |
50 | | - &len, |
51 | | - TRUE, |
52 | | - TRUE ); |
| 41 | + read_chars += len; |
| 42 | + } |
| 43 | + } |
| 44 | + else |
| 45 | + { |
| 46 | + res = fb_FileGetDataEx( handle, |
| 47 | + 0, |
| 48 | + (void *)dst, |
| 49 | + chars, |
| 50 | + &len, |
| 51 | + TRUE, |
| 52 | + TRUE ); |
53 | 53 | read_chars = chars; |
54 | | - } |
| 54 | + } |
55 | 55 |
|
56 | 56 | if( res == FB_RTERROR_OK ) |
57 | 57 | { |
|
0 commit comments