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
8a2545e4
Commit
8a2545e4
authored
Nov 10, 2015
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
makedep: Release extra string storage.
Also consistently use size_t type for string sizes. Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5a1067ad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
makedep.c
tools/makedep.c
+9
-9
No files found.
tools/makedep.c
View file @
8a2545e4
...
...
@@ -316,7 +316,7 @@ static char *strmake( const char* fmt, ... )
va_end
(
ap
);
if
(
n
==
-
1
)
size
*=
2
;
else
if
((
size_t
)
n
>=
size
)
size
=
n
+
1
;
else
return
p
;
else
return
xrealloc
(
p
,
n
+
1
)
;
free
(
p
);
}
}
...
...
@@ -327,8 +327,8 @@ static char *strmake( const char* fmt, ... )
*/
static
int
strendswith
(
const
char
*
str
,
const
char
*
end
)
{
int
l
=
strlen
(
str
);
int
m
=
strlen
(
end
);
size_t
l
=
strlen
(
str
);
size_t
m
=
strlen
(
end
);
return
l
>=
m
&&
strcmp
(
str
+
l
-
m
,
end
)
==
0
;
}
...
...
@@ -477,8 +477,8 @@ static char *get_extension( char *filename )
static
char
*
replace_extension
(
const
char
*
name
,
const
char
*
old_ext
,
const
char
*
new_ext
)
{
char
*
ret
;
in
t
name_len
=
strlen
(
name
);
in
t
ext_len
=
strlen
(
old_ext
);
size_
t
name_len
=
strlen
(
name
);
size_
t
ext_len
=
strlen
(
old_ext
);
if
(
name_len
>=
ext_len
&&
!
strcmp
(
name
+
name_len
-
ext_len
,
old_ext
))
name_len
-=
ext_len
;
ret
=
xmalloc
(
name_len
+
strlen
(
new_ext
)
+
1
);
...
...
@@ -507,9 +507,9 @@ static struct strarray strarray_replace_extension( const struct strarray *array,
/*******************************************************************
* replace_substr
*/
static
char
*
replace_substr
(
const
char
*
str
,
const
char
*
start
,
unsigned
in
t
len
,
const
char
*
replace
)
static
char
*
replace_substr
(
const
char
*
str
,
const
char
*
start
,
size_
t
len
,
const
char
*
replace
)
{
unsigned
in
t
pos
=
start
-
str
;
size_
t
pos
=
start
-
str
;
char
*
ret
=
xmalloc
(
pos
+
strlen
(
replace
)
+
strlen
(
start
+
len
)
+
1
);
memcpy
(
ret
,
str
,
pos
);
strcpy
(
ret
+
pos
,
replace
);
...
...
@@ -657,7 +657,7 @@ static char *tools_path( const struct makefile *make, const char *name )
static
char
*
get_line
(
FILE
*
file
)
{
static
char
*
buffer
;
static
unsigned
in
t
size
;
static
size_
t
size
;
if
(
!
size
)
{
...
...
@@ -1385,7 +1385,7 @@ static struct file *open_include_file( const struct makefile *make, struct incl_
/* try in src file directory */
if
((
p
=
strrchr
(
pFile
->
included_by
->
filename
,
'/'
)))
{
in
t
l
=
p
-
pFile
->
included_by
->
filename
+
1
;
size_
t
l
=
p
-
pFile
->
included_by
->
filename
+
1
;
filename
=
xmalloc
(
l
+
strlen
(
pFile
->
name
)
+
1
);
memcpy
(
filename
,
pFile
->
included_by
->
filename
,
l
);
strcpy
(
filename
+
l
,
pFile
->
name
);
...
...
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