Skip to content

Commit

Permalink
Rename utoa to avoid name conflict on Cygwin
Browse files Browse the repository at this point in the history
wryun#11 describes an issue when building on the Cygwin
platform; it defines its own 'utoa' function with a different signature.
It has been renamed to 'utostr'.
  • Loading branch information
memreflect committed Apr 6, 2022
1 parent 16c7f9e commit cc768f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions print.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ static Boolean sconv(Format *format) {
return FALSE;
}

static char *utoa(unsigned long u, char *t, unsigned int radix, char *digit) {
static char *utostr(unsigned long u, char *t, unsigned int radix, char *digit) {
if (u >= radix) {
t = utoa(u / radix, t, radix, digit);
t = utostr(u / radix, t, radix, digit);
u %= radix;
}
*t++ = digit[u];
Expand Down Expand Up @@ -104,7 +104,7 @@ static void intconv(Format *format, unsigned int radix, int upper, char *altform
while (*altform != '\0')
prefix[pre++] = *altform++;

len = utoa(u, number, radix, table[upper]) - number;
len = utostr(u, number, radix, table[upper]) - number;
if ((flags & FMT_f2set) && (size_t) format->f2 > len)
zeroes = format->f2 - len;
else
Expand Down

0 comments on commit cc768f4

Please sign in to comment.