audit small applets and mark some of them as NOFORK.

Put big scary warnings in relevant places.
This commit is contained in:
Denis Vlasenko
2007-04-10 15:43:37 +00:00
parent ff131b980d
commit 99912ca733
41 changed files with 173 additions and 128 deletions

View File

@@ -7,21 +7,22 @@
* Licensed under the GPL v2, see the file LICENSE in this tarball.
*/
#include <stdio.h>
#include <stdlib.h>
#include "busybox.h"
/* This is a NOFORK applet. Be very careful! */
int seq_main(int argc, char **argv);
int seq_main(int argc, char **argv)
{
double last, first, increment, i;
double last, increment, i;
first = increment = 1;
i = increment = 1;
switch (argc) {
case 4:
increment = atof(argv[2]);
case 3:
first = atof(argv[1]);
i = atof(argv[1]);
case 2:
last = atof(argv[argc-1]);
break;
@@ -30,12 +31,10 @@ int seq_main(int argc, char **argv)
}
/* You should note that this is pos-5.0.91 semantics, -- FK. */
for (i = first;
(increment > 0 && i <= last) || (increment < 0 && i >=last);
i += increment)
{
while ((increment > 0 && i <= last) || (increment < 0 && i >= last)) {
printf("%g\n", i);
i += increment;
}
return EXIT_SUCCESS;
return fflush(stdout);
}