summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--13.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/13.c b/13.c
index 9d876b6..42113f7 100644
--- a/13.c
+++ b/13.c
@@ -99,14 +99,14 @@ node_cmp(struct node * l, struct node * r)
ret = l->val_int - r->val_int;
}
else if (node_isint(l)) {
- struct node * tmp = node_create_list(l);
+ struct node * tmp = node_create_list(node_create_int(l->val_int));
ret = node_cmp(tmp, r);
- free(tmp); // Not node_free(), because we don't want to delete the contents
+ node_free(tmp);
}
else if (node_isint(r)) {
- struct node * tmp = node_create_list(r);
+ struct node * tmp = node_create_list(node_create_int(r->val_int));
ret = node_cmp(l, tmp);
- free(tmp); // Not node_free(), because we don't want to delete the contents
+ node_free(tmp);
}
else if (l == LIST_EMPTY && r == LIST_EMPTY) {
return 0;
@@ -229,7 +229,7 @@ main()
if ((j = node_cmp(n->val_list, n->next->val_list)) < 0) {
index_sum += i;
}
-#if 1
+#if 0
node_dump(n->val_list); fputc('\n', stderr);
node_dump(n->next->val_list); fputc('\n', stderr);
fprintf(stderr, "Result: %d (%s)\n", j, j < 0 ? "yes" : "no");