From 648f2760519e7c796f7960b6db947a19065b0bfc Mon Sep 17 00:00:00 2001 From: lux Date: Mon, 7 Aug 2017 15:11:23 +0200 Subject: [PATCH] chg. output ext. form cdump and chg strtoul param. * change the endptr parameter from strtoul to NULL (toy.c) * change the file extension in coredump from .txt to .toy --- src/debug/debug.c | 2 +- src/toy.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/debug/debug.c b/src/debug/debug.c index 25ac685..b5577a8 100644 --- a/src/debug/debug.c +++ b/src/debug/debug.c @@ -32,7 +32,7 @@ void makeHexDump(bool base_2, uint16_t ram[]) time(&timer); tm_timer=localtime(&timer); - if(strftime(timestamp,sizeof(timestamp),"coredump_%d_%b_%y_%T.txt",tm_timer)==0) + if(strftime(timestamp,sizeof(timestamp),"coredump_%d_%b_%y_%T.toy",tm_timer)==0) { fprintf(stderr,"Buffer for system-time fault! hexdump canceled\n"); return; diff --git a/src/toy.c b/src/toy.c index 9f06398..946ecaa 100644 --- a/src/toy.c +++ b/src/toy.c @@ -9,7 +9,7 @@ int initialise_ram(uint16_t *ram, int argc, char **argv ) FILE *fp; int j=0; char tempS[CPU_WORD_SIZE+1]; - char *end; +// char *end; if(argc<2) { @@ -42,7 +42,7 @@ int initialise_ram(uint16_t *ram, int argc, char **argv ) } } tempS[CPU_WORD_SIZE]='\0'; - ram[j]=strtoul(tempS,&end,2); + ram[j]=strtoul(tempS,NULL,2); j++; }while(tempS[0]!=EOF);