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
This commit is contained in:
lux 2017-08-07 15:11:23 +02:00
parent 168a8b9bcf
commit 648f276051
2 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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);