Commit b06b2fcd authored by Antonin Décimo's avatar Antonin Décimo Committed by Juliusz Chroboczek

Constify source argument of fromhex.

parent 9529941b
......@@ -197,7 +197,7 @@ parse_thousands(const char *string)
return -1;
}
int
static int
h2i(char c)
{
if(c >= '0' && c <= '9')
......@@ -211,7 +211,7 @@ h2i(char c)
}
int
fromhex(unsigned char *dest, char *src, int n)
fromhex(unsigned char *dst, const char *src, int n)
{
int i;
if(n % 2 != 0)
......@@ -224,7 +224,7 @@ fromhex(unsigned char *dest, char *src, int n)
b = h2i(src[i*2 + 1]);
if(b < 0)
return -1;
dest[i] = a*16 + b;
dst[i] = a*16 + b;
}
return n/2;
}
......
......@@ -79,8 +79,7 @@ void timeval_min(struct timeval *d, const struct timeval *s);
void timeval_min_sec(struct timeval *d, time_t secs);
int parse_nat(const char *string) ATTRIBUTE ((pure));
int parse_thousands(const char *string) ATTRIBUTE ((pure));
int h2i(char c);
int fromhex(unsigned char *dest, char *src, int n);
int fromhex(unsigned char *dst, const char *src, int n);
void do_debugf(int level, const char *format, ...)
ATTRIBUTE ((format (printf, 2, 3))) COLD;
int in_prefix(const unsigned char *restrict address,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment