From 4215394e00c9c6e9d36293112f30b1ed45654b71 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 29 Jul 2008 09:31:20 -0700 Subject: type_to_name returns immutable string Don't want accidental errors --- src/cli_new.c | 2 +- src/cli_val.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/cli_new.c b/src/cli_new.c index d9e1687..34f8af0 100644 --- a/src/cli_new.c +++ b/src/cli_new.c @@ -2103,7 +2103,7 @@ void touch() free(command); } -char *type_to_name(vtw_type_e type) { +const char *type_to_name(vtw_type_e type) { switch(type) { case INT_TYPE: return("u32"); case IPV4_TYPE: return("ipv4"); diff --git a/src/cli_val.h b/src/cli_val.h index c9d59a6..fa30479 100644 --- a/src/cli_val.h +++ b/src/cli_val.h @@ -187,7 +187,7 @@ extern void free_val(valstruct *val); extern void my_free(void *ptr); extern void touch(void); extern void dump_log(int argc, char **argv); -extern char *type_to_name(vtw_type_e type); +extern const char *type_to_name(vtw_type_e type); extern boolean execute_list(vtw_node *cur, vtw_def *def); extern void touch_dir(const char *dp); -- cgit v1.2.3