From 75f356b3858429015e8d24fe71ca00a874fa88f1 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Wed, 12 Aug 2009 07:46:21 +0200 Subject: [PATCH] Add "const" and remove compiler warningsy --- src/include/libradius.h | 2 +- src/lib/print.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/include/libradius.h b/src/include/libradius.h index 1d13e85d98b..31235225b5a 100644 --- a/src/include/libradius.h +++ b/src/include/libradius.h @@ -225,7 +225,7 @@ typedef struct radius_packet { /* * Printing functions. */ -int fr_utf8_char(uint8_t *str); +int fr_utf8_char(const uint8_t *str); void fr_print_string(const char *in, size_t inlen, char *out, size_t outlen); int vp_prints_value(char *out, size_t outlen, diff --git a/src/lib/print.c b/src/lib/print.c index 7d192379b1f..e122a7442e2 100644 --- a/src/lib/print.c +++ b/src/lib/print.c @@ -35,7 +35,7 @@ RCSID("$Id$") * Note that we don't care about the length of the input string, * because '\0' is an invalid UTF-8 character. */ -int fr_utf8_char(uint8_t *str) +int fr_utf8_char(const uint8_t *str) { if (*str < 0x20) return 0; @@ -129,7 +129,7 @@ int fr_utf8_char(uint8_t *str) */ void fr_print_string(const char *in, size_t inlen, char *out, size_t outlen) { - uint8_t *str = (uint8_t *)in; + const uint8_t *str = (const uint8_t *) in; int sp = 0; int utf8 = 0; @@ -176,7 +176,7 @@ void fr_print_string(const char *in, size_t inlen, char *out, size_t outlen) continue; } - utf8 = fr_utf8_char((uint8_t *)str); + utf8 = fr_utf8_char(str); if (!utf8) { snprintf(out, outlen, "\\%03o", *str); out += 4; -- 2.47.3