diff --git a/src/sp1/index.md b/src/sp1/index.md
index 70fa445..662ce9f 100644
--- a/src/sp1/index.md
+++ b/src/sp1/index.md
@@ -34,13 +34,10 @@ page_for: "sp1-lesson"
- Mail an mich: nova.ruff@fau.de
- [SP-FAQ](https://sys.cs.fau.de/lehre/ss25/sp1/faq)
-## Andere Tutoren
+## Andere Tutoren/Hilfreiche Links
- [SP1 Website](https://sys.cs.fau.de/lehre/ss25/sp1)
+- [cdecl.org](https://cdecl.org/) um zu entziffern, was bei Pointern passiert
- [Lukas (T03)](https://wwwcip.cs.fau.de/~uk16isyq/)
- [Julian (T08)](https://jzbor.de/tut/sp1/)
-- [Stefan (T09)](https://wwwcip.cs.fau.de/~ok73ozus/sp)
- [Luca (T11)](https://wwwcip.cs.fau.de/~am99ihig/sp)
-- [Philip (ehemalig)](https://wwwcip.cs.fau.de/~oj14ozun/sp1/)
-
-## Hilfreiche Links
-- [cdecl.org](https://cdecl.org/) um zu entziffern, was bei Pointern passiert
\ No newline at end of file
+- [Philip (ehemalig)](https://wwwcip.cs.fau.de/~oj14ozun/sp1/)
\ No newline at end of file
diff --git a/src/sp1/ub1.md b/src/sp1/ub1.md
index 7d44186..595aefe 100644
--- a/src/sp1/ub1.md
+++ b/src/sp1/ub1.md
@@ -106,7 +106,7 @@ int main(int argc, char *argv[]) {
### Speicher für structs anlegen
```c
-#include
+#include
struct listelement {
int value;
@@ -121,6 +121,6 @@ int main(int argc, char *argv[]) {
// ... rest vom program
- free(element1)
+ free(element1);
}
```
\ No newline at end of file
diff --git a/src/sp1/ub2.md b/src/sp1/ub2.md
new file mode 100644
index 0000000..48db1cf
--- /dev/null
+++ b/src/sp1/ub2.md
@@ -0,0 +1,64 @@
+---
+title: "Übung 02 - Fehlerbehandlung, Soriteren"
+layout: "blog-post.njk"
+tags: "sp1-lesson"
+date: 2025-05-13
+---
+## Valgrind
+Um mit Valgrind das Program während der Laufzeit zu analysieren, muss beim kompilieren das Program mit dem `-g` flag übersetzt worden sein.
+So kann Valgrind ausgeführt werden (mit den empfohlenen Flags aus der Übung):
+```bash
+valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ./lilo
+```
+weitere nützliche flags:
+- `--track-fds=yes`: Alle noch offenen file pointer bei beendigung des Programms ausgeben
+
+## Beispiel Programme aus der Präsenzübung
+### 20 Zufällig generierte Integers mit qsort() sortieren
+```c
+#include
+#include
+#include
+
+#define COUNT 20
+
+static int compare(const void *a, const void *b) {
+ // wir wissen, dass pointers zu integers gepasst werden (wir sortieren ints)
+ const int *ia = (const int *)a;
+ const int *ib = (const int *)b;
+
+ if (*ia < *ib) {
+ return -1;
+ } else if (*ia == *ib) {
+ return 0;
+ } else {
+ return +1;
+ }
+}
+
+int main(int argc, char *argv[]) {
+ srand(time(NULL));
+
+ // Speicher für die Zahlen anlegen
+ int *nums = malloc(sizeof(int) * COUNT);
+ if (nums == NULL) {
+ perror("malloc");
+ exit(EXIT_FAILURE);
+ }
+
+ // Zufallszahlen generieren
+ for (int i = 0; i < COUNT; i++) {
+ int r = rand();
+ nums[i] = r;
+ }
+
+ qsort(nums, COUNT, sizeof(int), compare);
+
+ // die zahlen sortiert auf stdout ausgeben
+ for (int i = 0; i < COUNT; i++) {
+ printf("%d\n", nums[i]);
+ }
+
+ exit(EXIT_SUCCESS)
+}
+```
\ No newline at end of file