Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
30892c8b
Commit
30892c8b
authored
Sep 06, 2007
by
Jeff Latimer
Committed by
Alexandre Julliard
Sep 10, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cabinet: Remove unnecessary function.
parent
7a04c24e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
25 deletions
+8
-25
fdi.c
dlls/cabinet/fdi.c
+8
-25
No files found.
dlls/cabinet/fdi.c
View file @
30892c8b
...
@@ -412,26 +412,6 @@ static long FDI_getoffset(HFDI hfdi, INT_PTR hf)
...
@@ -412,26 +412,6 @@ static long FDI_getoffset(HFDI hfdi, INT_PTR hf)
}
}
/**********************************************************************
/**********************************************************************
* FDI_realloc (internal)
*
* we can't use _msize; the user might not be using malloc, so we require
* an explicit specification of the previous size. inefficient.
*/
static
void
*
FDI_realloc
(
HFDI
hfdi
,
void
*
mem
,
size_t
prevsize
,
size_t
newsize
)
{
void
*
rslt
=
NULL
;
char
*
irslt
,
*
imem
;
size_t
copysize
=
(
prevsize
<
newsize
)
?
prevsize
:
newsize
;
if
(
prevsize
==
newsize
)
return
mem
;
rslt
=
PFDI_ALLOC
(
hfdi
,
newsize
);
if
(
rslt
)
for
(
irslt
=
(
char
*
)
rslt
,
imem
=
(
char
*
)
mem
;
(
copysize
);
copysize
--
)
*
irslt
++
=
*
imem
++
;
PFDI_FREE
(
hfdi
,
mem
);
return
rslt
;
}
/**********************************************************************
* FDI_read_string (internal)
* FDI_read_string (internal)
*
*
* allocate and read an arbitrarily long string from the cabinet
* allocate and read an arbitrarily long string from the cabinet
...
@@ -439,19 +419,17 @@ static void *FDI_realloc(HFDI hfdi, void *mem, size_t prevsize, size_t newsize)
...
@@ -439,19 +419,17 @@ static void *FDI_realloc(HFDI hfdi, void *mem, size_t prevsize, size_t newsize)
static
char
*
FDI_read_string
(
HFDI
hfdi
,
INT_PTR
hf
,
long
cabsize
)
static
char
*
FDI_read_string
(
HFDI
hfdi
,
INT_PTR
hf
,
long
cabsize
)
{
{
size_t
len
=
256
,
size_t
len
=
256
,
oldlen
=
0
,
base
=
FDI_getoffset
(
hfdi
,
hf
),
base
=
FDI_getoffset
(
hfdi
,
hf
),
maxlen
=
cabsize
-
base
;
maxlen
=
cabsize
-
base
;
BOOL
ok
=
FALSE
;
BOOL
ok
=
FALSE
;
unsigned
int
i
;
unsigned
int
i
;
cab_UBYTE
*
buf
=
NULL
;
cab_UBYTE
*
buf
=
NULL
;
TRACE
(
"(hfdi == ^%p, hf == %ld
)
\n
"
,
hfdi
,
hf
);
TRACE
(
"(hfdi == ^%p, hf == %ld
, cabsize == %ld)
\n
"
,
hfdi
,
hf
,
cabsize
);
do
{
do
{
if
(
len
>
maxlen
)
len
=
maxlen
;
if
(
len
>
maxlen
)
len
=
maxlen
;
if
(
!
(
buf
=
FDI_realloc
(
hfdi
,
buf
,
oldlen
,
len
)))
break
;
if
(
!
(
buf
=
PFDI_ALLOC
(
hfdi
,
len
)))
break
;
oldlen
=
len
;
if
(
!
PFDI_READ
(
hfdi
,
hf
,
buf
,
len
))
break
;
if
(
!
PFDI_READ
(
hfdi
,
hf
,
buf
,
len
))
break
;
/* search for a null terminator in what we've just read */
/* search for a null terminator in what we've just read */
...
@@ -464,8 +442,13 @@ static char *FDI_read_string(HFDI hfdi, INT_PTR hf, long cabsize)
...
@@ -464,8 +442,13 @@ static char *FDI_read_string(HFDI hfdi, INT_PTR hf, long cabsize)
ERR
(
"cabinet is truncated
\n
"
);
ERR
(
"cabinet is truncated
\n
"
);
break
;
break
;
}
}
len
+=
256
;
/* The buffer is too small for the string. Reset the file to the point
* were we started, free the buffer and increase the size for the next try
*/
PFDI_SEEK
(
hfdi
,
hf
,
base
,
SEEK_SET
);
PFDI_SEEK
(
hfdi
,
hf
,
base
,
SEEK_SET
);
PFDI_FREE
(
hfdi
,
buf
);
buf
=
NULL
;
len
*=
2
;
}
}
}
while
(
!
ok
);
}
while
(
!
ok
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment