static unsigned int fill_package_struct(char *control_buffer)
{
+ static const char *const field_names[] = { "Package", "Version",
+ "Pre-Depends", "Depends","Replaces", "Provides",
+ "Conflicts", "Suggests", "Recommends", "Enhances", 0
+ };
+
common_node_t *new_node = (common_node_t *) xcalloc(1, sizeof(common_node_t));
- const char *field_names[] = { "Package", "Version", "Pre-Depends", "Depends",
- "Replaces", "Provides", "Conflicts", "Suggests", "Recommends", "Enhances", 0};
char *field_name;
char *field_value;
int field_start = 0;
overwrite = (overwrite == o_prompt) ? o_never : overwrite;
} else {
- char *extn[] = {"", ".zip", ".ZIP"};
+ static const char *const extn[] = {"", ".zip", ".ZIP"};
int orig_src_fn_len = strlen(src_fn);
for(i = 0; (i < 3) && (src_fd == -1); i++) {
strcpy(src_fn + orig_src_fn_len, extn[i]);
extern int env_main(int argc, char** argv)
{
+ static char *cleanenv[1] = { NULL };
+
char **ep, *p;
- char *cleanenv[1] = { NULL };
unsigned long opt;
llist_t *unset_env = NULL;
extern char **environ;
{ 0x858458f6, "romfs" },
{ 0x73717368, "squashfs" },
{ 0x62656572, "sysfs" },
- { 0, "UNKNOWN" },
- { 0, NULL }
+ { 0, "UNKNOWN" }
};
for (i=0; humantypes[i].type; ++i)
if (humantypes[i].type == f_type)
- return humantypes[i].fs;
+ break;
return humantypes[i].fs;
}
int halt_main(int argc, char *argv[])
{
+ static const int magic[] = {RB_HALT_SYSTEM, RB_POWER_OFF, RB_AUTOBOOT};
+ static const int signals[] = {SIGUSR1, SIGUSR2, SIGTERM};
+
char *delay = "hpr";
- int which, flags, magic[] = {RB_HALT_SYSTEM, RB_POWER_OFF, RB_AUTOBOOT},
- signals[] = {SIGUSR1, SIGUSR2, SIGTERM}, rc = 1;
+ int which, flags, rc = 1;
/* Figure out which applet we're running */
for(which=0;delay[which]!=*bb_applet_name;which++);
char name[STRING_LENGTH];
char * msg="";
char *ptr;
+ int i;
/* !!!! Only Uppercase Keywords in devsfd.conf */
- const char *options[] = { "CLEAR_CONFIG", "INCLUDE", "OPTIONAL_INCLUDE", "RESTORE",
- "PERMISSIONS", "MODLOAD", "EXECUTE", "COPY", "IGNORE",
- "MKOLDCOMPAT", "MKNEWCOMPAT","RMOLDCOMPAT", "RMNEWCOMPAT", 0 };
-
- int i;
+ static const char *const options[] = {
+ "CLEAR_CONFIG", "INCLUDE", "OPTIONAL_INCLUDE",
+ "RESTORE", "PERMISSIONS", "MODLOAD", "EXECUTE",
+ "COPY", "IGNORE", "MKOLDCOMPAT", "MKNEWCOMPAT",
+ "RMOLDCOMPAT", "RMNEWCOMPAT", 0
+ };
debug_msg_logger(LOG_INFO, __FUNCTION__);
-
for (count = 0; count < MAX_ARGS; ++count) p[count][0] = '\0';
num_args = sscanf (line, "%s %s %s %s %s %s %s %s %s %s",
when, name, what,
if ( ( ptr = strchr (p[0], '.') ) == NULL )
{
msg="UID.GID";
- goto process_config_line_err; /*"missing '.' in UID.GID */
+ goto process_config_line_err; /*"missing '.' in UID.GID"*/
}
*ptr++ = '\0';
unsigned int i;
char rewind_;
/* 1 to 5 "scsi/" , 6 to 9 "ide/host" */
- const char *fmt[] = { NULL ,
- "sg/c%db%dt%du%d", /* scsi/generic */
- "sd/c%db%dt%du%d", /* scsi/disc */
- "sr/c%db%dt%du%d", /* scsi/cd */
- "sd/c%db%dt%du%dp%d", /* scsi/part */
- "st/c%db%dt%du%dm%d%c", /* scsi/mt */
- "ide/hd/c%db%dt%du%d", /* ide/host/disc */
- "ide/cd/c%db%dt%du%d", /* ide/host/cd */
- "ide/hd/c%db%dt%du%dp%d", /* ide/host/part */
- "ide/mt/c%db%dt%du%d%s", /* ide/host/mt */
- NULL };
+ static const char *const fmt[] = {
+ NULL ,
+ "sg/c%db%dt%du%d", /* scsi/generic */
+ "sd/c%db%dt%du%d", /* scsi/disc */
+ "sr/c%db%dt%du%d", /* scsi/cd */
+ "sd/c%db%dt%du%dp%d", /* scsi/part */
+ "st/c%db%dt%du%dm%d%c", /* scsi/mt */
+ "ide/hd/c%db%dt%du%d", /* ide/host/disc */
+ "ide/cd/c%db%dt%du%d", /* ide/host/cd */
+ "ide/hd/c%db%dt%du%dp%d", /* ide/host/part */
+ "ide/mt/c%db%dt%du%d%s", /* ide/host/mt */
+ NULL
+ };
/* First construct compatibility name */
switch (action)
const char *pty2;
size_t len;
/* 1 to 5 "scsi/" , 6 to 9 "ide/host", 10 sbp/, 11 vcc/, 12 pty/ */
- const char *fmt[] = { NULL ,
- "sg%u", /* scsi/generic */
- NULL, /* scsi/disc */
- "sr%u", /* scsi/cd */
- NULL, /* scsi/part */
- "nst%u%c", /* scsi/mt */
- "hd%c" , /* ide/host/disc */
- "hd%c" , /* ide/host/cd */
- "hd%c%s", /* ide/host/part */
- "%sht%d", /* ide/host/mt */
- "sbpcd%u", /* sbp/ */
- "vcs%s", /* vcc/ */
- "%cty%c%c", /* pty/ */
- NULL };
+ static const char *const fmt[] = {
+ NULL ,
+ "sg%u", /* scsi/generic */
+ NULL, /* scsi/disc */
+ "sr%u", /* scsi/cd */
+ NULL, /* scsi/part */
+ "nst%u%c", /* scsi/mt */
+ "hd%c" , /* ide/host/disc */
+ "hd%c" , /* ide/host/cd */
+ "hd%c%s", /* ide/host/part */
+ "%sht%d", /* ide/host/mt */
+ "sbpcd%u", /* sbp/ */
+ "vcs%s", /* vcc/ */
+ "%cty%c%c", /* pty/ */
+ NULL
+ };
debug_msg_logger(LOG_INFO, __FUNCTION__);
static void dump_identity (const struct hd_driveid *id)
{
int i;
- char pmodes[64] = {0,}, dmodes[128]={0,}, umodes[128]={0,};
+ char pmodes[64], dmodes[128], umodes[128];
const unsigned short int *id_regs= (const void*) id;
unsigned long capacity;
+ pmodes[0] = dmodes[0] = umodes[0] = '\0';
+
printf("\n Model=%.40s, FwRev=%.8s, SerialNo=%.20s\n Config={",
id->model, id->fw_rev, id->serial_no);
for (i=0; i<=15; i++)
extern int ipaddr_list_or_flush(int argc, char **argv, int flush)
{
- const char *option[] = { "to", "scope", "up", "label", "dev", 0 };
+ static const char *const option[] = { "to", "scope", "up", "label", "dev", 0 };
+
struct nlmsg_list *linfo = NULL;
struct nlmsg_list *ainfo = NULL;
struct nlmsg_list *l;
if (filter_dev) {
filter.ifindex = ll_name_to_index(filter_dev);
if (filter.ifindex <= 0) {
- bb_error_msg("Device \"%s\" does not exist.", filter_dev);
+ bb_error_msg("Device \"%s\" does not exist", filter_dev);
return -1;
}
}
static int ipaddr_modify(int cmd, int argc, char **argv)
{
- const char *option[] = { "peer", "remote", "broadcast", "brd",
- "anycast", "scope", "dev", "label", "local", 0 };
+ static const char *const option[] = {
+ "peer", "remote", "broadcast", "brd",
+ "anycast", "scope", "dev", "label", "local", 0
+ };
+
struct rtnl_handle rth;
struct {
struct nlmsghdr n;
uint32_t scope = 0;
NEXT_ARG();
if (rtnl_rtscope_a2n(&scope, *argv)) {
- invarg(*argv, "invalid scope value.");
+ invarg(*argv, "invalid scope value");
}
req.ifa.ifa_scope = scope;
scoped = 1;
}
if (d == NULL) {
- bb_error_msg("Not enough information: \"dev\" argument is required.");
+ bb_error_msg("Not enough information: \"dev\" argument is required");
return -1;
}
if (l && matches(d, l) != 0) {
- bb_error_msg_and_die("\"dev\" (%s) must match \"label\" (%s).", d, l);
+ bb_error_msg_and_die("\"dev\" (%s) must match \"label\" (%s)", d, l);
}
if (peer_len == 0 && local_len && cmd != RTM_DELADDR) {
extern int do_ipaddr(int argc, char **argv)
{
- const char *commands[] = { "add", "delete", "list", "show", "lst", "flush", 0 };
+ static const char *const commands[] = {
+ "add", "delete", "list", "show", "lst", "flush", 0
+ };
+
int command_num = 2;
if (*argv) {
/* read a packet from socket fd, return -1 on read error, -2 on packet error */
int get_packet(struct dhcpMessage *packet, int fd)
{
- int bytes;
- int i;
- const char broken_vendors[][8] = {
+ static const char broken_vendors[][8] = {
"MSFT 98",
""
};
+
+ int bytes;
+ int i;
char unsigned *vendor;
memset(packet, 0, sizeof(struct dhcpMessage));