diff options
Diffstat (limited to '13.c')
-rw-r--r-- | 13.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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"); |