From 87f4567d04c1fbe0b7d01ead5605417960c27cde Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 21 Jun 2004 22:48:38 +0000 Subject: [PATCH] Me esta tirando un segmentation fault en el free(salida), si alguien lo puede ver... :-/ --- src/blocksorting/Makefile | 4 ++-- src/blocksorting/main.c | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/blocksorting/Makefile b/src/blocksorting/Makefile index d65621e..98a9877 100644 --- a/src/blocksorting/Makefile +++ b/src/blocksorting/Makefile @@ -28,8 +28,8 @@ extension = c ########################### # Opciones para el compilador C. -#CFLAGS = -Wall -ggdb -ansi -pedantic -DDEBUG -CFLAGS = -Wall -O3 -ansi -pedantic -DNDEBUG -g +CFLAGS = -Wall -ggdb -ansi -pedantic -DDEBUG +#CFLAGS = -Wall -O3 -ansi -pedantic -DNDEBUG -g # Opciones para el compilador C++. #CXXFLAGS = $(CFLAGS) -fno-inline diff --git a/src/blocksorting/main.c b/src/blocksorting/main.c index 704c570..c3ae302 100644 --- a/src/blocksorting/main.c +++ b/src/blocksorting/main.c @@ -15,7 +15,7 @@ int main(int argc, char *argv[]) fp = fopen(argv[1], "r"); len = atoi(argv[2]); } else if (argc == 2) { - fp = stdin; /*fopen(argv[1], "r");*/ + fp = stdin; len = atoi(argv[1]); } else { printf("no, no\n"); @@ -48,13 +48,12 @@ int main(int argc, char *argv[]) bs_restore(orig, salida, k, i); printf("Orig : %s\n", orig); } else - printf("(%s)\n", salida); + fwrite(salida, 1, i, fp); } fclose(fp); bs_destroy(bs); - printf("Total bytes : %ld\n", total); - free(data); + /*printf("Total bytes : %ld\n", total);*/ free(salida); free(orig); return 0; -- 2.43.0