mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
elinks_ulongcat: Make the static strings const.
And simplify an expression to avoid a cast.
This commit is contained in:
parent
ada3858372
commit
ac339cf5e5
@ -52,9 +52,9 @@ elinks_ulongcat(unsigned char *s, unsigned int *slen,
|
|||||||
unsigned char fillchar, unsigned int base,
|
unsigned char fillchar, unsigned int base,
|
||||||
unsigned int upper)
|
unsigned int upper)
|
||||||
{
|
{
|
||||||
static unsigned char unum[]= "0123456789ABCDEF";
|
static const unsigned char unum[]= "0123456789ABCDEF";
|
||||||
static unsigned char lnum[]= "0123456789abcdef";
|
static const unsigned char lnum[]= "0123456789abcdef";
|
||||||
unsigned char *to_num = (unsigned char *) (upper ? &unum : &lnum);
|
const unsigned char *to_num = (upper ? unum : lnum);
|
||||||
unsigned int start = slen ? *slen : 0;
|
unsigned int start = slen ? *slen : 0;
|
||||||
unsigned int nlen = 1; /* '0' is one char, we can't have less. */
|
unsigned int nlen = 1; /* '0' is one char, we can't have less. */
|
||||||
unsigned int pos = start; /* starting position of the number */
|
unsigned int pos = start; /* starting position of the number */
|
||||||
|
Loading…
Reference in New Issue
Block a user