From 1f0262bcdb352e9a75a4e5f48cd63d05714e2859 Mon Sep 17 00:00:00 2001 From: "\"Vladimir N. Oleynik\"" Date: Thu, 20 Oct 2005 11:17:48 +0000 Subject: another more const --- e2fsprogs/e2p/feature.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'e2fsprogs/e2p/feature.c') diff --git a/e2fsprogs/e2p/feature.c b/e2fsprogs/e2p/feature.c index a4f3c64cb..fe6016102 100644 --- a/e2fsprogs/e2p/feature.c +++ b/e2fsprogs/e2p/feature.c @@ -22,7 +22,7 @@ struct feature { const char *string; }; -static struct feature feature_list[] = { +static const struct feature feature_list[] = { { E2P_FEATURE_COMPAT, EXT2_FEATURE_COMPAT_DIR_PREALLOC, "dir_prealloc" }, { E2P_FEATURE_COMPAT, EXT3_FEATURE_COMPAT_HAS_JOURNAL, @@ -56,7 +56,7 @@ static struct feature feature_list[] = { const char *e2p_feature2string(int compat, unsigned int mask) { - struct feature *f; + const struct feature *f; static char buf[20]; char fchar; int fnum; @@ -87,7 +87,7 @@ const char *e2p_feature2string(int compat, unsigned int mask) int e2p_string2feature(char *string, int *compat_type, unsigned int *mask) { - struct feature *f; + const struct feature *f; char *eptr; int num; @@ -154,8 +154,7 @@ int e2p_edit_feature(const char *str, __u32 *compat_array, __u32 *ok_array) unsigned int mask; int compat_type; - buf = xmalloc(strlen(str)+1); - strcpy(buf, str); + buf = bb_xstrdup(str); cp = buf; while (cp && *cp) { neg = 0; -- cgit v1.2.3