From 458b8ce2cc450596f2130eec1e4023f4bb4e61ab Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Mon, 17 Sep 2012 14:17:24 +0300 Subject: [PATCH] samples: separate code blocks, remove extra empty lines at the end of files --- samples/AssignmentAddressToInteger/bad.c | 2 +- samples/AssignmentAddressToInteger/good.c | 3 +-- samples/arrayIndexOutOfBounds/bad.c | 1 - samples/arrayIndexOutOfBounds/good.c | 1 - samples/autoVariables/bad.c | 1 - samples/autoVariables/good.c | 1 - samples/bufferAccessOutOfBounds/bad.c | 1 - samples/bufferAccessOutOfBounds/good.c | 1 - samples/erase/bad.cpp | 1 - samples/erase/good.cpp | 1 - samples/memleak/good.c | 1 - samples/outOfBounds/bad.c | 1 - samples/outOfBounds/good.c | 1 - samples/resourceLeak/bad.c | 1 - samples/resourceLeak/good.c | 1 - samples/syntaxError/bad.c | 1 - samples/syntaxError/good.c | 1 - 17 files changed, 2 insertions(+), 18 deletions(-) diff --git a/samples/AssignmentAddressToInteger/bad.c b/samples/AssignmentAddressToInteger/bad.c index ca721f548..ab4704fed 100644 --- a/samples/AssignmentAddressToInteger/bad.c +++ b/samples/AssignmentAddressToInteger/bad.c @@ -3,9 +3,9 @@ int foo(int *p) int a = p; return a + 4; } + int main() { int i[10]; foo(i); } - diff --git a/samples/AssignmentAddressToInteger/good.c b/samples/AssignmentAddressToInteger/good.c index ebddc4b8c..32b68628c 100644 --- a/samples/AssignmentAddressToInteger/good.c +++ b/samples/AssignmentAddressToInteger/good.c @@ -2,10 +2,9 @@ int* foo(int *p) { return p + 4; } + int main() { int i[10]; foo(i); } - - diff --git a/samples/arrayIndexOutOfBounds/bad.c b/samples/arrayIndexOutOfBounds/bad.c index a71f2b151..e738cbcd0 100644 --- a/samples/arrayIndexOutOfBounds/bad.c +++ b/samples/arrayIndexOutOfBounds/bad.c @@ -6,4 +6,3 @@ int main() a[2] = 0; return a[0]; } - diff --git a/samples/arrayIndexOutOfBounds/good.c b/samples/arrayIndexOutOfBounds/good.c index 825ebcf49..7b42abfec 100644 --- a/samples/arrayIndexOutOfBounds/good.c +++ b/samples/arrayIndexOutOfBounds/good.c @@ -6,4 +6,3 @@ int main() a[2] = 0; return a[0]; } - diff --git a/samples/autoVariables/bad.c b/samples/autoVariables/bad.c index f7f64a7a9..c18718866 100644 --- a/samples/autoVariables/bad.c +++ b/samples/autoVariables/bad.c @@ -9,4 +9,3 @@ int main() int *c; foo(&c); } - diff --git a/samples/autoVariables/good.c b/samples/autoVariables/good.c index 1c8732e2b..61cb17e42 100644 --- a/samples/autoVariables/good.c +++ b/samples/autoVariables/good.c @@ -10,4 +10,3 @@ int main() int *c = &b; foo(&c); } - diff --git a/samples/bufferAccessOutOfBounds/bad.c b/samples/bufferAccessOutOfBounds/bad.c index 88708c3e0..169a2d1de 100644 --- a/samples/bufferAccessOutOfBounds/bad.c +++ b/samples/bufferAccessOutOfBounds/bad.c @@ -6,4 +6,3 @@ int main() a[i] = 0; return a[0]; } - diff --git a/samples/bufferAccessOutOfBounds/good.c b/samples/bufferAccessOutOfBounds/good.c index 244854764..62fa9eb55 100644 --- a/samples/bufferAccessOutOfBounds/good.c +++ b/samples/bufferAccessOutOfBounds/good.c @@ -6,4 +6,3 @@ int main() a[i] = 0; return a[0]; } - diff --git a/samples/erase/bad.cpp b/samples/erase/bad.cpp index 9e83d1ad3..0f8b83aaa 100644 --- a/samples/erase/bad.cpp +++ b/samples/erase/bad.cpp @@ -12,4 +12,3 @@ int main() } } } - diff --git a/samples/erase/good.cpp b/samples/erase/good.cpp index 1049075ca..3f011bb3d 100644 --- a/samples/erase/good.cpp +++ b/samples/erase/good.cpp @@ -14,4 +14,3 @@ int main() } } } - diff --git a/samples/memleak/good.c b/samples/memleak/good.c index f15054e70..862f35fc7 100644 --- a/samples/memleak/good.c +++ b/samples/memleak/good.c @@ -8,4 +8,3 @@ int main() free(a); return result; } - diff --git a/samples/outOfBounds/bad.c b/samples/outOfBounds/bad.c index 63f7c4628..61237c0ea 100644 --- a/samples/outOfBounds/bad.c +++ b/samples/outOfBounds/bad.c @@ -4,4 +4,3 @@ int main() char str[5]; snprintf(str, 10, "%s", "abc"); } - diff --git a/samples/outOfBounds/good.c b/samples/outOfBounds/good.c index b194f7501..a103928f9 100644 --- a/samples/outOfBounds/good.c +++ b/samples/outOfBounds/good.c @@ -4,4 +4,3 @@ int main() char str[10]; snprintf(str, 10, "%s", "abc"); } - diff --git a/samples/resourceLeak/bad.c b/samples/resourceLeak/bad.c index 65235ed12..b517297a1 100644 --- a/samples/resourceLeak/bad.c +++ b/samples/resourceLeak/bad.c @@ -7,4 +7,3 @@ int main() return 0; } - diff --git a/samples/resourceLeak/good.c b/samples/resourceLeak/good.c index 25e93216b..328597568 100644 --- a/samples/resourceLeak/good.c +++ b/samples/resourceLeak/good.c @@ -7,4 +7,3 @@ int main() fclose(a); return 0; } - diff --git a/samples/syntaxError/bad.c b/samples/syntaxError/bad.c index 58ed3ff86..e5ee0115f 100644 --- a/samples/syntaxError/bad.c +++ b/samples/syntaxError/bad.c @@ -3,4 +3,3 @@ int main() #ifndef A } #endif - diff --git a/samples/syntaxError/good.c b/samples/syntaxError/good.c index be49d773f..0686f8ecb 100644 --- a/samples/syntaxError/good.c +++ b/samples/syntaxError/good.c @@ -3,4 +3,3 @@ int main() #ifndef A #endif } -