From 7de1f286de85fd1e8359eee716536666a76fbb88 Mon Sep 17 00:00:00 2001 From: Amit Shah Date: Thu, 19 Mar 2009 18:19:42 +0530 Subject: Fix segfault: filename has to be an array Signed-off-by: Amit Shah --- Makefile | 2 +- test-file-zero-alloc-speed.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 482c49b..48509b9 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # Author: Amit Shah CC = gcc -CFLAGS = -Werror -Os +CFLAGS = -Werror -g .PHONY: all diff --git a/test-file-zero-alloc-speed.c b/test-file-zero-alloc-speed.c index 10c3a18..73a7975 100644 --- a/test-file-zero-alloc-speed.c +++ b/test-file-zero-alloc-speed.c @@ -58,7 +58,6 @@ int do_posix_fallocate(char *name, off_t len) return 0; } -#if 1 int do_fallocate(char *name, off_t len) { int r, fd; @@ -86,7 +85,6 @@ int do_fallocate(char *name, off_t len) return 0; } -#endif int do_mmap(char *name, off_t len) { @@ -168,7 +166,7 @@ int do_write_chunks(char *name, off_t len, size_t chunk_size) int main(int argc, char **argv) { char *basename; - char *filename; + char filename[200]; if (argc < 2) { printf("usage: %s base-dir\n", argv[0]); -- cgit