remove unneeded #includes, fix indentation
This commit is contained in:
parent
c1876d7364
commit
c290563319
|
@ -38,15 +38,6 @@
|
||||||
|
|
||||||
// 19990508 Busy Boxed! Dave Cinege
|
// 19990508 Busy Boxed! Dave Cinege
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <assert.h>
|
|
||||||
#include "busybox.h"
|
#include "busybox.h"
|
||||||
|
|
||||||
static int print_formatted(char *format, int argc, char **argv);
|
static int print_formatted(char *format, int argc, char **argv);
|
||||||
|
@ -54,14 +45,16 @@ static void print_direc (char *start, size_t length,
|
||||||
int field_width, int precision, char *argument);
|
int field_width, int precision, char *argument);
|
||||||
|
|
||||||
typedef int (*converter)(char *arg, void *result);
|
typedef int (*converter)(char *arg, void *result);
|
||||||
|
|
||||||
static void multiconvert(char *arg, void *result, converter convert)
|
static void multiconvert(char *arg, void *result, converter convert)
|
||||||
{
|
{
|
||||||
char s[16];
|
char s[16];
|
||||||
if (*arg == '"' || *arg == '\'') {
|
if (*arg == '"' || *arg == '\'') {
|
||||||
sprintf(s,"%d",(unsigned)*(++arg));
|
sprintf(s, "%d", (unsigned)arg[1]);
|
||||||
arg = s;
|
arg = s;
|
||||||
}
|
}
|
||||||
if(convert(arg,result)) fprintf(stderr, "%s", arg);
|
if (convert(arg, result))
|
||||||
|
fputs(arg, stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned long xstrtoul(char *arg)
|
static unsigned long xstrtoul(char *arg)
|
||||||
|
@ -104,7 +97,7 @@ int printf_main(int argc, char **argv)
|
||||||
char *format;
|
char *format;
|
||||||
int args_used;
|
int args_used;
|
||||||
|
|
||||||
if (argc <= 1 || **(argv + 1) == '-') {
|
if (argc <= 1 || argv[1][0] == '-') {
|
||||||
bb_show_usage();
|
bb_show_usage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,8 +112,7 @@ int printf_main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
while (args_used > 0 && argc > 0);
|
while (args_used > 0 && argc > 0);
|
||||||
|
|
||||||
/*
|
/* if (argc > 0)
|
||||||
if (argc > 0)
|
|
||||||
fprintf(stderr, "excess args ignored");
|
fprintf(stderr, "excess args ignored");
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -7,11 +7,6 @@
|
||||||
* Special function for busybox written by Vladimir Oleynik <dzo@simtreas.ru>
|
* Special function for busybox written by Vladimir Oleynik <dzo@simtreas.ru>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <limits.h>
|
|
||||||
#include <sys/param.h>
|
|
||||||
#include "libbb.h"
|
#include "libbb.h"
|
||||||
|
|
||||||
/* Amount to increase buffer size by in each try. */
|
/* Amount to increase buffer size by in each try. */
|
||||||
|
@ -41,7 +36,7 @@ xgetcwd (char *cwd)
|
||||||
|
|
||||||
if (ret == NULL) {
|
if (ret == NULL) {
|
||||||
free(cwd);
|
free(cwd);
|
||||||
bb_perror_msg("getcwd()");
|
bb_perror_msg("getcwd");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,12 +32,11 @@ int runlevel_main(int argc, char *argv[])
|
||||||
if (prev == 0) prev = 'N';
|
if (prev == 0) prev = 'N';
|
||||||
printf("%c %c\n", prev, ut->ut_pid % 256);
|
printf("%c %c\n", prev, ut->ut_pid % 256);
|
||||||
endutent();
|
endutent();
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("unknown\n");
|
puts("unknown");
|
||||||
endutent();
|
endutent();
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user