aboutsummaryrefslogtreecommitdiff
path: root/e2fsprogs
diff options
context:
space:
mode:
Diffstat (limited to 'e2fsprogs')
-rw-r--r--e2fsprogs/e2p/feature.c9
-rw-r--r--e2fsprogs/e2p/hashstr.c6
-rw-r--r--e2fsprogs/e2p/mntopts.c9
-rw-r--r--e2fsprogs/e2p/ostype.c7
-rw-r--r--e2fsprogs/e2p/pf.c4
-rw-r--r--e2fsprogs/fsck.c11
6 files changed, 22 insertions, 24 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;
diff --git a/e2fsprogs/e2p/hashstr.c b/e2fsprogs/e2p/hashstr.c
index 7c0552f09..c4b3f9fd5 100644
--- a/e2fsprogs/e2p/hashstr.c
+++ b/e2fsprogs/e2p/hashstr.c
@@ -21,7 +21,7 @@ struct hash {
21 const char *string; 21 const char *string;
22}; 22};
23 23
24static struct hash hash_list[] = { 24static const struct hash hash_list[] = {
25 { EXT2_HASH_LEGACY, "legacy" }, 25 { EXT2_HASH_LEGACY, "legacy" },
26 { EXT2_HASH_HALF_MD4, "half_md4" }, 26 { EXT2_HASH_HALF_MD4, "half_md4" },
27 { EXT2_HASH_TEA, "tea" }, 27 { EXT2_HASH_TEA, "tea" },
@@ -30,7 +30,7 @@ static struct hash hash_list[] = {
30 30
31const char *e2p_hash2string(int num) 31const char *e2p_hash2string(int num)
32{ 32{
33 struct hash *p; 33 const struct hash *p;
34 static char buf[20]; 34 static char buf[20];
35 35
36 for (p = hash_list; p->string; p++) { 36 for (p = hash_list; p->string; p++) {
@@ -46,7 +46,7 @@ const char *e2p_hash2string(int num)
46 */ 46 */
47int e2p_string2hash(char *string) 47int e2p_string2hash(char *string)
48{ 48{
49 struct hash *p; 49 const struct hash *p;
50 char *eptr; 50 char *eptr;
51 int num; 51 int num;
52 52
diff --git a/e2fsprogs/e2p/mntopts.c b/e2fsprogs/e2p/mntopts.c
index 735260ce0..562a9ccc1 100644
--- a/e2fsprogs/e2p/mntopts.c
+++ b/e2fsprogs/e2p/mntopts.c
@@ -21,7 +21,7 @@ struct mntopt {
21 const char *string; 21 const char *string;
22}; 22};
23 23
24static struct mntopt mntopt_list[] = { 24static const struct mntopt mntopt_list[] = {
25 { EXT2_DEFM_DEBUG, "debug" }, 25 { EXT2_DEFM_DEBUG, "debug" },
26 { EXT2_DEFM_BSDGROUPS, "bsdgroups" }, 26 { EXT2_DEFM_BSDGROUPS, "bsdgroups" },
27 { EXT2_DEFM_XATTR_USER, "user_xattr" }, 27 { EXT2_DEFM_XATTR_USER, "user_xattr" },
@@ -35,7 +35,7 @@ static struct mntopt mntopt_list[] = {
35 35
36const char *e2p_mntopt2string(unsigned int mask) 36const char *e2p_mntopt2string(unsigned int mask)
37{ 37{
38 struct mntopt *f; 38 const struct mntopt *f;
39 static char buf[20]; 39 static char buf[20];
40 int fnum; 40 int fnum;
41 41
@@ -50,7 +50,7 @@ const char *e2p_mntopt2string(unsigned int mask)
50 50
51int e2p_string2mntopt(char *string, unsigned int *mask) 51int e2p_string2mntopt(char *string, unsigned int *mask)
52{ 52{
53 struct mntopt *f; 53 const struct mntopt *f;
54 char *eptr; 54 char *eptr;
55 int num; 55 int num;
56 56
@@ -99,8 +99,7 @@ int e2p_edit_mntopts(const char *str, __u32 *mntopts, __u32 ok)
99 int neg; 99 int neg;
100 unsigned int mask; 100 unsigned int mask;
101 101
102 buf = xmalloc(strlen(str)+1); 102 buf = bb_xstrdup(str);
103 strcpy(buf, str);
104 cp = buf; 103 cp = buf;
105 while (cp && *cp) { 104 while (cp && *cp) {
106 neg = 0; 105 neg = 0;
diff --git a/e2fsprogs/e2p/ostype.c b/e2fsprogs/e2p/ostype.c
index a079b57b1..1084abde2 100644
--- a/e2fsprogs/e2p/ostype.c
+++ b/e2fsprogs/e2p/ostype.c
@@ -10,7 +10,7 @@
10#include "e2p.h" 10#include "e2p.h"
11#include <string.h> 11#include <string.h>
12 12
13const char *os_tab[] = 13static const char * const os_tab[] =
14 { "Linux", 14 { "Linux",
15 "Hurd", 15 "Hurd",
16 "Masix", 16 "Masix",
@@ -31,8 +31,7 @@ char *e2p_os2string(int os_type)
31 else 31 else
32 os = "(unknown os)"; 32 os = "(unknown os)";
33 33
34 ret = xmalloc(strlen(os)+1); 34 ret = bb_xstrdup(os);
35 strcpy(ret, os);
36 return ret; 35 return ret;
37} 36}
38 37
@@ -41,7 +40,7 @@ char *e2p_os2string(int os_type)
41 */ 40 */
42int e2p_string2os(char *str) 41int e2p_string2os(char *str)
43{ 42{
44 const char **cpp; 43 const char * const *cpp;
45 int i = 0; 44 int i = 0;
46 45
47 for (cpp = os_tab; *cpp; cpp++, i++) { 46 for (cpp = os_tab; *cpp; cpp++, i++) {
diff --git a/e2fsprogs/e2p/pf.c b/e2fsprogs/e2p/pf.c
index d1a1c4caa..2194ac6bf 100644
--- a/e2fsprogs/e2p/pf.c
+++ b/e2fsprogs/e2p/pf.c
@@ -24,7 +24,7 @@ struct flags_name {
24 const char *long_name; 24 const char *long_name;
25}; 25};
26 26
27static struct flags_name flags_array[] = { 27static const struct flags_name flags_array[] = {
28 { EXT2_SECRM_FL, "s", "Secure_Deletion" }, 28 { EXT2_SECRM_FL, "s", "Secure_Deletion" },
29 { EXT2_UNRM_FL, "u" , "Undelete" }, 29 { EXT2_UNRM_FL, "u" , "Undelete" },
30 { EXT2_SYNC_FL, "S", "Synchronous_Updates" }, 30 { EXT2_SYNC_FL, "S", "Synchronous_Updates" },
@@ -50,7 +50,7 @@ static struct flags_name flags_array[] = {
50void print_flags (FILE * f, unsigned long flags, unsigned options) 50void print_flags (FILE * f, unsigned long flags, unsigned options)
51{ 51{
52 int long_opt = (options & PFOPT_LONG); 52 int long_opt = (options & PFOPT_LONG);
53 struct flags_name *fp; 53 const struct flags_name *fp;
54 int first = 1; 54 int first = 1;
55 55
56 for (fp = flags_array; fp->flag != 0; fp++) { 56 for (fp = flags_array; fp->flag != 0; fp++) {
diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c
index 802d7fa86..b7e25d68a 100644
--- a/e2fsprogs/fsck.c
+++ b/e2fsprogs/fsck.c
@@ -116,7 +116,7 @@ struct fsck_instance {
116 * Required for the uber-silly devfs /dev/ide/host1/bus2/target3/lun3 116 * Required for the uber-silly devfs /dev/ide/host1/bus2/target3/lun3
117 * pathames. 117 * pathames.
118 */ 118 */
119static const char *devfs_hier[] = { 119static const char * const devfs_hier[] = {
120 "host", "bus", "target", "lun", 0 120 "host", "bus", "target", "lun", 0
121}; 121};
122#endif 122#endif
@@ -125,7 +125,8 @@ static char *base_device(const char *device)
125{ 125{
126 char *str, *cp; 126 char *str, *cp;
127#ifdef CONFIG_FEATURE_DEVFS 127#ifdef CONFIG_FEATURE_DEVFS
128 const char **hier, *disk; 128 const char * const *hier;
129 const char *disk;
129 int len; 130 int len;
130#endif 131#endif
131 132
@@ -866,9 +867,9 @@ struct fs_type_compile {
866#define FS_TYPE_OPT 1 867#define FS_TYPE_OPT 1
867#define FS_TYPE_NEGOPT 2 868#define FS_TYPE_NEGOPT 2
868 869
869static const char *fs_type_syntax_error = 870static const char fs_type_syntax_error[] =
870N_("Either all or none of the filesystem types passed to -t must be prefixed\n" 871"Either all or none of the filesystem types passed to -t must be prefixed\n"
871 "with 'no' or '!'.\n"); 872 "with 'no' or '!'.";
872 873
873static void compile_fs_type(char *fs_type, struct fs_type_compile *cmp) 874static void compile_fs_type(char *fs_type, struct fs_type_compile *cmp)
874{ 875{