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
3a503499
Commit
3a503499
authored
Sep 12, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly handle the case where vsnprintf returns -1.
parent
d559fbd8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
utils.c
tools/winegcc/utils.c
+5
-5
No files found.
tools/winegcc/utils.c
View file @
3a503499
...
...
@@ -79,18 +79,18 @@ char* strmake(const char* fmt, ...)
{
int
n
;
size_t
size
=
100
;
char
*
p
;
va_list
ap
;
p
=
xmalloc
(
size
);
while
(
1
)
{
char
*
p
=
xmalloc
(
size
);
va_start
(
ap
,
fmt
);
n
=
vsnprintf
(
p
,
size
,
fmt
,
ap
);
va_end
(
ap
);
if
(
n
>
-
1
&&
(
size_t
)
n
<
size
)
return
p
;
size
=
min
(
size
*
2
,
(
size_t
)
n
+
1
);
p
=
xrealloc
(
p
,
size
);
if
(
n
==
-
1
)
size
*=
2
;
else
if
((
size_t
)
n
>=
size
)
size
=
n
+
1
;
else
return
p
;
free
(
p
);
}
}
...
...
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