Skip to content
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: Rename ap_copy to aq for G_aprintf #3651

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/gis/aprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,11 @@ static int oaprintf(struct options *opts, const char *format, va_list ap)
while (*++c && *q != *c)
;
if (*c) {
va_list ap_copy;
va_list aq;
char tmp;

/* copy ap for ovprintf() */
va_copy(ap_copy, ap);
va_copy(aq, ap);

/* found a conversion specifier */
if (*c == 's') {
Expand Down Expand Up @@ -254,7 +254,7 @@ static int oaprintf(struct options *opts, const char *format, va_list ap)
}
if (*p_spec) {
/* illegal string specifier? */
va_end(ap_copy);
va_end(aq);
*(q + 1) = 0;
G_fatal_error(
_("Failed to parse string specifier: %s"), p);
Expand Down Expand Up @@ -290,15 +290,15 @@ static int oaprintf(struct options *opts, const char *format, va_list ap)
if (use_ovprintf) {
tmp = *(q + 1);
*(q + 1) = 0;
nbytes += ovprintf(opts, p, ap_copy);
nbytes += ovprintf(opts, p, aq);
*(q + 1) = tmp;
}
}
else {
/* else use ovprintf() for non-string specifiers */
tmp = *(q + 1);
*(q + 1) = 0;
nbytes += ovprintf(opts, p, ap_copy);
nbytes += ovprintf(opts, p, aq);
*(q + 1) = tmp;

/* once ap is passed to another function that calls
Expand Down Expand Up @@ -345,7 +345,7 @@ static int oaprintf(struct options *opts, const char *format, va_list ap)
/* otherwise, no argument is required for m% */
}
}
va_end(ap_copy);
va_end(aq);
break;
}
else if (p_spec - spec < SPEC_BUF_SIZE - 2)
Expand Down
Loading