summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex AUVOLAT <alex.auvolat@ens.fr>2013-12-10 16:51:50 +0100
committerAlex AUVOLAT <alex.auvolat@ens.fr>2013-12-10 16:51:50 +0100
commit9f43600ea65189e7fae39f9ed3e592cbb19de11f (patch)
tree5621ba085537f97c684a641e08b6d22ee99dea24
parent3a1b146a5761db20d243ae5224a962eeca19b506 (diff)
downloadAlgoProg-Projet-9f43600ea65189e7fae39f9ed3e592cbb19de11f.tar.gz
AlgoProg-Projet-9f43600ea65189e7fae39f9ed3e592cbb19de11f.zip
Corrected a bug.HEADmaster
-rw-r--r--graph.c3
-rw-r--r--set_linked_lists.c1
2 files changed, 3 insertions, 1 deletions
diff --git a/graph.c b/graph.c
index 4d3ba2a..a8e933c 100644
--- a/graph.c
+++ b/graph.c
@@ -43,7 +43,8 @@ graph load_graph_dimacs(FILE *stream) {
fprintf(stderr, "File format error (expected 'p' declaration)\n");
return NULL;
}
- fscanf(stream, " col %d %d\n", &n, &m); // read node count
+ fscanf(stream, " col"); fscanf(stream, " edge"); // either col or edge
+ fscanf(stream, " %d %d\n", &n, &m); // read node count
fprintf(stderr, "Load DIMACS: n = %d, m = %d\n", n, m);
graph k = malloc(sizeof(struct graph_descriptor));
diff --git a/set_linked_lists.c b/set_linked_lists.c
index 004e55a..46d0c8d 100644
--- a/set_linked_lists.c
+++ b/set_linked_lists.c
@@ -68,6 +68,7 @@ set full_set(int n) {
for (i = 0; i < n; i++) {
element e = malloc(sizeof(struct set_elt));
e->value = i;
+ e->next = NULL;
if (prev == NULL) {
k->first = e;
} else {