diff options
author | dlenev@brandersnatch.localdomain <> | 2004-05-27 17:54:40 +0400 |
---|---|---|
committer | dlenev@brandersnatch.localdomain <> | 2004-05-27 17:54:40 +0400 |
commit | 03b705ff4408f011eebdadffeb249e9ef533c3ea (patch) | |
tree | 0a3ac45d591f6d81591a9b4ec19f2d45e2c29570 /mysys | |
parent | fc85c80b88c0717684184f22a91f8b027a8f8559 (diff) | |
download | mariadb-git-03b705ff4408f011eebdadffeb249e9ef533c3ea.tar.gz |
Made my_snprintf() behavior snprintf() compatible when printing %x arguments (it should
produce hex digits in lower case). (fixed version)
Replaced _dig_vec array with two _dig_vec_upper/_dig_vec_lower arrays.
Added extra argument to int2str function which controls case of digits you get.
Replaced lot of invocations of int2str for decimal radix with more optimized int10_to_str()
function.
Removed unused my_itoa/my_ltoa functions.
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/mf_tempfile.c | 2 | ||||
-rw-r--r-- | mysys/my_error.c | 4 | ||||
-rw-r--r-- | mysys/my_tempnam.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/mysys/mf_tempfile.c b/mysys/mf_tempfile.c index 14b8fdc430c..e2ad71654dc 100644 --- a/mysys/mf_tempfile.c +++ b/mysys/mf_tempfile.c @@ -181,7 +181,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix, for (length=0 ; length < 8 && uniq ; length++) { - *end_pos++= _dig_vec[(int) (uniq & 31)]; + *end_pos++= _dig_vec_upper[(int) (uniq & 31)]; uniq >>= 5; } (void) strmov(end_pos,TMP_EXT); diff --git a/mysys/my_error.c b/mysys/my_error.c index 6fd346c89f7..33d79bbc5e6 100644 --- a/mysys/my_error.c +++ b/mysys/my_error.c @@ -90,9 +90,9 @@ int my_error(int nr,myf MyFlags, ...) register int iarg; iarg = va_arg(ap, int); if (*tpos == 'd') - plen= (uint) (int2str((long) iarg,endpos, -10) - endpos); + plen= (uint) (int10_to_str((long) iarg, endpos, -10) - endpos); else - plen= (uint) (int2str((long) (uint) iarg,endpos,10)- endpos); + plen= (uint) (int10_to_str((long) (uint) iarg, endpos, 10) - endpos); if (olen + plen < ERRMSGSIZE+2) /* Replace parameter if possible */ { endpos+=plen; diff --git a/mysys/my_tempnam.c b/mysys/my_tempnam.c index b4f76727ee0..9f765298fb6 100644 --- a/mysys/my_tempnam.c +++ b/mysys/my_tempnam.c @@ -161,7 +161,7 @@ my_string my_tempnam(const char *dir, const char *pfx, for (length=0 ; length < 8 && uniq ; length++) { - *end_pos++= _dig_vec[(int) (uniq & 31)]; + *end_pos++= _dig_vec_upper[(int) (uniq & 31)]; uniq >>= 5; } VOID(strmov(end_pos,TMP_EXT)); |