int ndelim = -1; /* zero-based / one-based problem */
int nfields_printed = 0;
char *field = NULL;
- const char delimiter[2] = { delim, 0 };
+ char delimiter[2];
+
+ delimiter[0] = delim;
+ delimiter[1] = 0;
/* does this line contain any delimiters? */
if (strchr(line, delim) == NULL) {
{ "M", 1048576 },
{ "GD", 1000000000 },
{ "G", 1073741824 },
- { }
+ { "", 0 }
};
struct globals {
static VALUE *docolon(VALUE *sv, VALUE *pv)
{
+ enum { NMATCH = 2 };
VALUE *v;
regex_t re_buffer;
- const int NMATCH = 2;
regmatch_t re_regs[NMATCH];
tostring(sv);
{ "b", 512 },
{ "k", 1024 },
{ "m", 1024*1024 },
- { }
+ { "", 0 }
};
#endif
static const struct suffix_mult Bb[] = {
{ "B", 1024 },
{ "b", 512 },
- { }
+ { "", 0 }
};
char *p;
int radix;
{ "b", 512 },
{ "k", 1024 },
{ "m", 1024*1024 },
- { }
+ { "", 0 }
};
enum {
OPT_A = 1 << 0,
{ "m", 60 },
{ "h", 60*60 },
{ "d", 24*60*60 },
- { }
+ { "", 0 }
};
#endif
#if ENABLE_FEATURE_SPLIT_FANCY
{ "g", 1024*1024*1024 },
#endif
- { }
+ { "", 0 }
};
/* Increment the suffix part of the filename.
{ "b", 512 },
{ "k", 1024 },
{ "B", 1024 },
- { }
+ { "", 0 }
};
static const struct mode_info *find_mode(const char *name)
{ "b", 512 },
{ "k", 1024 },
{ "m", 1024*1024 },
- { }
+ { "", 0 }
};
struct globals {
* Fix handling of -a to not print "unknown", add -o and -i support.
*/
-#include <sys/utsname.h>
#include "libbb.h"
+/* After libbb.h, since it needs sys/types.h on some systems */
+#include <sys/utsname.h>
typedef struct {
struct utsname name;
{ "", 512 },
{ "b", 512 },
{ "k", 1024 },
- { }
+ { "", 0 }
};
action_size *ap;
ap = ALLOC_ACTION(size);
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
-#include <sys/utsname.h> /* for uname(2) */
-
#include "libbb.h"
+/* After libbb.h, since it needs sys/types.h on some systems */
+#include <sys/utsname.h> /* for uname(2) */
+
/* Returns current kernel version encoded as major*65536 + minor*256 + patch,
* so, for example, to check if the kernel is greater than 2.2.11:
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
-#include <sys/param.h> /* MAXHOSTNAMELEN */
-#include <sys/utsname.h>
#include "libbb.h"
+/* After libbb.h, since it needs sys/types.h on some systems */
+#include <sys/utsname.h>
#define LOGIN " login: "
* Licensed under GPLv2, see file LICENSE in this tarball for details.
*/
+#include <sys/socket.h> /* netinet/in.h needs it */
#include <netinet/in.h>
#include <net/if.h>
#include <sys/un.h>
{"p", print_no_pop},
{"f", print_stack_no_pop},
{"o", set_output_base},
- { /* zero filled */ }
+ { "", NULL }
};
static void stack_machine(const char *argument)
static const struct suffix_mult suffixes[] = {
{ "ms", 1 },
{ "", 1000 },
- { }
+ { "", 0 }
};
unsigned opts;
#undef _GNU_SOURCE
#define _GNU_SOURCE
-#include <libbb.h>
-#include <sys/utsname.h> /* uname() */
+#include "libbb.h"
#include "modutils.h"
+#include <sys/utsname.h> /* uname() */
/*
* Theory of operation:
*/
#include "libbb.h"
-
+/* After libbb.h, since it needs sys/types.h on some systems */
#include <sys/utsname.h> /* uname() */
#include <fnmatch.h>
* Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
*/
+#include "libbb.h"
+/* After libbb.h, since it needs sys/types.h on some systems */
#include <sys/utsname.h>
#include <fnmatch.h>
-#include "libbb.h"
-
#define MAX_OPT_DEPTH 10
#define EUNBALBRACK 10001
#define EUNDEFVAR 10002
* with "option XXX YYY" syntax in dhcpd config file. */
{ OPTION_U16 , 0x39 }, /* DHCP_MAX_SIZE */
- { } /* zeroed terminating entry */
+ { 0, 0 } /* zeroed terminating entry */
};
/* Used for converting options from incoming packets to env variables
static const struct suffix_mult km_suffixes[] = {
{ "k", 1024 },
{ "m", 1024*1024 },
- { }
+ { "", 0 }
};
ld->sizemax = xatou_sfx(&s[1], km_suffixes);
break;
{ "m", 60 },
{ "h", 60*60 },
/*{ "d", 24*60*60 },*/
- { }
+ { "", 0 }
};
ld->rotate_period = xatou_sfx(&s[1], mh_suffixes);
if (ld->rotate_period) {
{ "{" , '{' },
{ "}" , '}' },
{ "." , DOT },
- { },
+ { "" , 0 },
};
const struct res *rp;
{ "b", 512 },
{ "k", 1024 },
{ "m", 1024*1024 },
- { }
+ { "", 0 }
};
int hexdump_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
-#include <sys/utsname.h>
#include "libbb.h"
+/* After libbb.h, since it needs sys/types.h on some systems */
+#include <sys/utsname.h>
#include "rtc_.h"
#if ENABLE_FEATURE_HWCLOCK_LONG_OPTIONS
static void to_sys_clock(int utc)
{
struct timeval tv;
- const struct timezone tz = { timezone/60 - 60*daylight, 0 };
+ struct timezone tz;
+
+ tz.tz_minuteswest = timezone/60 - 60*daylight;
+ tz.tz_dsttime = 0;
tv.tv_sec = read_rtc(utc);
tv.tv_usec = 0;