X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Ftimothy_tests%2Flinux_tests%2Flib.c;fp=direct%2Ftimothy_tests%2Flinux_tests%2Flib.c;h=5f439040e3ee891677bec7cfc7168d759a80e138;hp=ffc9b0555f468449abca88f6702f53e0f9d824be;hb=8cbfc1e273db791447911631e80c0495c6171ca8;hpb=79333a6e009cc468a6c15ff1077f3bc389fd85e9 diff --git a/direct/timothy_tests/linux_tests/lib.c b/direct/timothy_tests/linux_tests/lib.c index ffc9b05..5f43904 100644 --- a/direct/timothy_tests/linux_tests/lib.c +++ b/direct/timothy_tests/linux_tests/lib.c @@ -15,6 +15,8 @@ static char message[200]; static int PRINT_LEVEL = 3; static int exit_on_error_val =1; +char string[FILE_NAME_LENGTH+1]; + int get_exit_on_error(void) { @@ -31,7 +33,7 @@ node * linked_list_add_node(int pos,node *head_node) node *new_node=NULL; if (pos==HEAD){ new_node=malloc(sizeof(node)); - memset(new_node, NULL, sizeof(node)); + memset(new_node, 0, sizeof(node)); new_node->string=NULL; new_node->next=head_node; return new_node; @@ -64,7 +66,7 @@ int delete_linked_list(node *head_node) char * generate_random_string(unsigned int length) { - char string[length+1]; + unsigned int x; for (x=0;x<(length-1);x++) { @@ -73,6 +75,7 @@ char * generate_random_string(unsigned int length) string[x]='\0'; return string; } + void set_print_level(int new_level) { PRINT_LEVEL=new_level; @@ -84,12 +87,12 @@ int get_print_level(void) void print_message(char print_level,char *message) { if (print_level <= PRINT_LEVEL){ - printf(message); + printf("%s",message); } } -unsigned int random_int(void) +int random_int(void) { - return (random()%4294967295); + return (random()%1000000); } void check_function(int output)