better compile scripts, fixed some code
This commit is contained in:
parent
fb0938d2c3
commit
dbe1895350
|
@ -21,7 +21,6 @@ int main(){
|
||||||
bin[i] = b;
|
bin[i] = b;
|
||||||
}
|
}
|
||||||
for(int j = 0; j < 16; j++){
|
for(int j = 0; j < 16; j++){
|
||||||
if(
|
|
||||||
printf("%d", bin[j]);
|
printf("%d", bin[j]);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
BIN
bin/7-teiler
BIN
bin/7-teiler
Binary file not shown.
BIN
bin/7teiler
BIN
bin/7teiler
Binary file not shown.
Binary file not shown.
BIN
bin/calculator
BIN
bin/calculator
Binary file not shown.
Binary file not shown.
BIN
bin/complex
BIN
bin/complex
Binary file not shown.
BIN
bin/echochar
BIN
bin/echochar
Binary file not shown.
BIN
bin/factorial
BIN
bin/factorial
Binary file not shown.
BIN
bin/hello-world
BIN
bin/hello-world
Binary file not shown.
BIN
bin/options
BIN
bin/options
Binary file not shown.
Binary file not shown.
BIN
bin/pointermagic
BIN
bin/pointermagic
Binary file not shown.
BIN
bin/primenumbers
BIN
bin/primenumbers
Binary file not shown.
BIN
bin/quersumme
BIN
bin/quersumme
Binary file not shown.
BIN
bin/readfile
BIN
bin/readfile
Binary file not shown.
BIN
bin/redefinition
BIN
bin/redefinition
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/scanf-test
BIN
bin/scanf-test
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/sizeofs
BIN
bin/sizeofs
Binary file not shown.
BIN
bin/success
BIN
bin/success
Binary file not shown.
BIN
bin/tabtest
BIN
bin/tabtest
Binary file not shown.
BIN
bin/umlaut
BIN
bin/umlaut
Binary file not shown.
Binary file not shown.
|
@ -1,3 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
echo "compiling all files in working directory $(pwd)"
|
returnCode=0
|
||||||
for file in $(/bin/ls); do ./compile.sh $file; done
|
echo -e "compiling all files in working directory $(pwd)\n"
|
||||||
|
for file in $(/bin/ls *.c);
|
||||||
|
do
|
||||||
|
./compile.sh $file;
|
||||||
|
if [ "$?" -ne 0 ]
|
||||||
|
then
|
||||||
|
echo -e "\nERROR: could not compile $file !\n";
|
||||||
|
returnCode=1;
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
exit $returnCode
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
noext=$(echo "$1" | cut -f 1 -d '.')
|
noext=$(echo "$1" | cut -f 1 -d '.')
|
||||||
gcc $1 -o bin/$noext
|
./compile $1
|
||||||
./bin/$noext $2 $3 $4 $5 $6 $7 $8 $9
|
./bin/$noext $2 $3 $4 $5 $6 $7 $8 $9
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
echo "compiling $1..."
|
echo "compiling $1 ..."
|
||||||
noext=$(echo "$1" | cut -f 1 -d '.')
|
noext=$(echo "$1" | cut -f 1 -d '.')
|
||||||
gcc $1 -o bin/$noext
|
gcc $1 -o bin/$noext -lm
|
||||||
|
|
11
echo.c
11
echo.c
|
@ -2,7 +2,16 @@
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
char s[100];
|
char s[100];
|
||||||
gets(s);
|
//gets(s);
|
||||||
|
/*
|
||||||
|
* Never use gets(). Because it is impossible to tell without knowing the data in advance how many characters gets() will read, and be‐
|
||||||
|
* cause gets() will continue to store characters past the end of the buffer, it is extremely dangerous to use. It has been used to break
|
||||||
|
* computer security. Use fgets() instead.
|
||||||
|
*
|
||||||
|
* For more information, see CWE-242 (aka "Use of Inherently Dangerous Function") at http://cwe.mitre.org/data/definitions/242.html
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
fgets(s, sizeof(s), stdin);
|
||||||
printf("%s\n", s);
|
printf("%s\n", s);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue