-
-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libgis: G_vasprintf bug fix #3650
base: main
Are you sure you want to change the base?
Conversation
@nilason What's your opinion on this? It was fixing a bug 6 months ago caught in the cmake PR. |
The build errors were no longer visible, so I updated the branch again. |
The error is Details:
|
|
||
for (;;) { | ||
if (count >= osize) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This addresses the warning, and take into account if the previous vsnprintf call fails.
if (count >= osize) { | |
if (count < 0) | |
return count; | |
if ((size_t)count >= osize) { |
This PR fixes a
G_vasprintf
bug for#else
of#ifdef HAVE_ASPRINTF
.From the man page of
vsnprintf()
:size *= 2
becausecount
is already the full length without\0
if it's greater than or equal tosize
.ap
cannot be reused in a for loop. It needs to be copied before its first use so we can use it again.