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:
parent
168a8b9bcf
commit
648f276051
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user