1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-29 03:17:53 -04:00

elinks_ulongcat: Make the static strings const.

And simplify an expression to avoid a cast.
This commit is contained in:
Kalle Olavi Niemitalo 2007-01-28 01:28:44 +02:00 committed by Kalle Olavi Niemitalo
parent ada3858372
commit ac339cf5e5

View File

@ -52,9 +52,9 @@ elinks_ulongcat(unsigned char *s, unsigned int *slen,
unsigned char fillchar, unsigned int base,
unsigned int upper)
{
static unsigned char unum[]= "0123456789ABCDEF";
static unsigned char lnum[]= "0123456789abcdef";
unsigned char *to_num = (unsigned char *) (upper ? &unum : &lnum);
static const unsigned char unum[]= "0123456789ABCDEF";
static const unsigned char lnum[]= "0123456789abcdef";
const unsigned char *to_num = (upper ? unum : lnum);
unsigned int start = slen ? *slen : 0;
unsigned int nlen = 1; /* '0' is one char, we can't have less. */
unsigned int pos = start; /* starting position of the number */