Skip to content

Commit defa47b

Browse files
committed
Fix files with linting & formatting tools + spelling correction
1 parent deb48ef commit defa47b

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

man.md

-1
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,3 @@ Md Jahidul Hamid <[email protected]>
127127

128128
# REPORT BUGS TO
129129
https://github.com/neurobin/shc/issues
130-

src/shc.c

+10-11
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ static const char version[] = "Version 4.0.3";
2121
static const char subject[] = "Generic Shell Script Compiler";
2222
static const char cpright[] = "GNU GPL Version 3";
2323
static const struct { const char * f, * s, * e; }
24-
provider = { "Md Jahidul", "Hamid", "<[email protected]>" };
24+
provider = { "Md Jahidul", "Hamid", "<[email protected]>" };
2525

26-
/*
26+
/*
2727
static const struct { const char * f, * s, * e; }
2828
author = { "Francisco", "Garcia", "<[email protected]>" };
2929
*/
@@ -57,7 +57,7 @@ static const char * abstract[] = {
5757
" of the script specified at command line.",
5858
"",
5959
" Binary version will be saved with a .x extension by default.",
60-
" You can specify output file name too with [-o filname] option.",
60+
" You can specify output file name too with [-o outfile] option.",
6161
"",
6262
" You can specify expiration date [-e] too, after which binary will",
6363
" refuse to be executed, displaying \"[-m]\" instead.",
@@ -67,7 +67,7 @@ static const char * abstract[] = {
6767
"",
6868
0};
6969

70-
static const char usage[] =
70+
static const char usage[] =
7171
"Usage: shc [-e date] [-m addr] [-i iopt] [-x cmd] [-l lopt] [-o outfile] [-rvDSUHCAB2h] -f script";
7272

7373
static const char * help[] = {
@@ -279,7 +279,7 @@ static const char * RTC[] = {
279279
"}",
280280
"",
281281
"/*",
282-
" * Crypt data. ",
282+
" * Encrypt data. ",
283283
" */",
284284
"void arc4(void * str, int len)",
285285
"{",
@@ -895,7 +895,7 @@ static void parse_args(int argc, char * argv[])
895895
if (ret == -1)
896896
err++;
897897
} while (ret);
898-
898+
899899
if (err) {
900900
fprintf(stderr, "\n%s %s\n\n", my_name, usage);
901901
exit(1);
@@ -907,7 +907,7 @@ static void parse_args(int argc, char * argv[])
907907
static unsigned char stte[256], indx, jndx, kndx;
908908

909909
/*
910-
* Reset arc4 stte.
910+
* Reset arc4 stte.
911911
*/
912912
void stte_0(void)
913913
{
@@ -918,7 +918,7 @@ void stte_0(void)
918918
}
919919

920920
/*
921-
* Set key. Can be used more than once.
921+
* Set key. Can be used more than once.
922922
*/
923923
void key(void * str, int len)
924924
{
@@ -937,7 +937,7 @@ void key(void * str, int len)
937937
}
938938

939939
/*
940-
* Crypt data.
940+
* Encrypt data.
941941
*/
942942
void arc4(void * str, int len)
943943
{
@@ -1167,7 +1167,7 @@ void prnt_array(FILE * o, void * ptr, char * name, int l, char * cast)
11671167
int m = rand_mod(1+l/4); /* Random amount of random pre padding (offset) */
11681168
int n = rand_mod(1+l/4); /* Random amount of random post padding (tail) */
11691169
int a = (offset+m)%l;
1170-
if (cast && a) m += l - a; /* Type alignement. */
1170+
if (cast && a) m += l - a; /* Type alignment. */
11711171
fprintf(o, "\n");
11721172
fprintf(o, "#define %s_z %d", name, l);
11731173
fprintf(o, "\n");
@@ -1361,4 +1361,3 @@ int main(int argc, char * argv[])
13611361
exit(1);
13621362
return 1;
13631363
}
1364-

test/pru.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ echo "$0" "$@"
33
ps $$
44
ps wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww $$
55
cat /proc/$$/cmdline
6-
touch $0.kk
7-
read ENTER
6+
touch "$0.kk"
7+
# shellcheck disable=SC2034
8+
read -r ENTER

test/ttest.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ pc=0
1616
fc=0
1717
echo
1818
echo "== Running tests ..."
19-
for shell in ${shells[@]}; do
19+
for shell in "${shells[@]}"; do
2020
for opt in "${check_opts[@]}"; do
2121
tmpd=$(mktemp -d)
22-
tmpf="$tmpd/test.$(basename $shell)"
22+
tmpf="$tmpd/test.$(basename "$shell")"
2323
echo '#!'"$shell
2424
echo 'Hello World fp:'\$1 sp:\$2
2525
" > "$tmpf"
26+
# shellcheck disable=SC2086
2627
"$shc" $opt -f "$tmpf" -o "$tmpd/a.out"
2728
out=$("$tmpd/a.out" first second)
2829
#~ echo " Output: $out"

0 commit comments

Comments
 (0)