aboutsummaryrefslogtreecommitdiff
path: root/e2fsprogs/e2p/feature.c
diff options
context:
space:
mode:
Diffstat (limited to 'e2fsprogs/e2p/feature.c')
-rw-r--r--e2fsprogs/e2p/feature.c9
1 files changed, 4 insertions, 5 deletions
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 {
22 const char *string; 22 const char *string;
23}; 23};
24 24
25static struct feature feature_list[] = { 25static const struct feature feature_list[] = {
26 { E2P_FEATURE_COMPAT, EXT2_FEATURE_COMPAT_DIR_PREALLOC, 26 { E2P_FEATURE_COMPAT, EXT2_FEATURE_COMPAT_DIR_PREALLOC,
27 "dir_prealloc" }, 27 "dir_prealloc" },
28 { E2P_FEATURE_COMPAT, EXT3_FEATURE_COMPAT_HAS_JOURNAL, 28 { E2P_FEATURE_COMPAT, EXT3_FEATURE_COMPAT_HAS_JOURNAL,
@@ -56,7 +56,7 @@ static struct feature feature_list[] = {
56 56
57const char *e2p_feature2string(int compat, unsigned int mask) 57const char *e2p_feature2string(int compat, unsigned int mask)
58{ 58{
59 struct feature *f; 59 const struct feature *f;
60 static char buf[20]; 60 static char buf[20];
61 char fchar; 61 char fchar;
62 int fnum; 62 int fnum;
@@ -87,7 +87,7 @@ const char *e2p_feature2string(int compat, unsigned int mask)
87 87
88int e2p_string2feature(char *string, int *compat_type, unsigned int *mask) 88int e2p_string2feature(char *string, int *compat_type, unsigned int *mask)
89{ 89{
90 struct feature *f; 90 const struct feature *f;
91 char *eptr; 91 char *eptr;
92 int num; 92 int num;
93 93
@@ -154,8 +154,7 @@ int e2p_edit_feature(const char *str, __u32 *compat_array, __u32 *ok_array)
154 unsigned int mask; 154 unsigned int mask;
155 int compat_type; 155 int compat_type;
156 156
157 buf = xmalloc(strlen(str)+1); 157 buf = bb_xstrdup(str);
158 strcpy(buf, str);
159 cp = buf; 158 cp = buf;
160 while (cp && *cp) { 159 while (cp && *cp) {
161 neg = 0; 160 neg = 0;