Skip to content

Commit

Permalink
Update main.c
Browse files Browse the repository at this point in the history
  • Loading branch information
ManojTGN committed Apr 10, 2024
1 parent fb3ecf8 commit 59afb70
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ void printData(asciiParams params){
uint8_t* hyphens = (uint8_t*)calloc( (size_t)maxLength[i],sizeof(uint8_t));
memset(hyphens, (uint8_t)45, sizeof(uint8_t) * (size_t)maxLength[i]);

uint8_t* fHyphens = (uint8_t*)calloc( (params.onlyDec?5:0) + (params.onlyOct?5:0) + (params.onlyHex?5:0) + (params.onlyChar?4:0),sizeof(uint8_t));
memset(fHyphens, (uint8_t)45, sizeof(uint8_t) * ((params.onlyDec?5:0) + (params.onlyOct?5:0) + (params.onlyHex?5:0) + (params.onlyChar?4:0)));
uint8_t* fHyphens = (uint8_t*)calloc( params._onlyAll?19:(params.onlyDec?5:0) + (params.onlyOct?5:0) + (params.onlyHex?5:0) + (params.onlyChar?4:0),sizeof(uint8_t));
memset(fHyphens, (uint8_t)45, sizeof(uint8_t) * (params._onlyAll?19:(params.onlyDec?5:0) + (params.onlyOct?5:0) + (params.onlyHex?5:0) + (params.onlyChar?4:0)));

printf("%s%s",fHyphens,hyphens);
if(col-1 != i) printf("+--");
Expand All @@ -96,8 +96,8 @@ void printData(asciiParams params){
uint8_t* hyphens = (uint8_t*)calloc( (size_t)maxLength[i],sizeof(uint8_t));
memset(hyphens, (uint8_t)45, sizeof(uint8_t) * (size_t)maxLength[i]);

uint8_t* fHyphens = (uint8_t*)calloc( (params.onlyDec?5:0) + (params.onlyOct?5:0) + (params.onlyHex?5:0) + (params.onlyChar?4:0),sizeof(uint8_t));
memset(fHyphens, (uint8_t)45, sizeof(uint8_t) * ((params.onlyDec?5:0) + (params.onlyOct?5:0) + (params.onlyHex?5:0) + (params.onlyChar?4:0)));
uint8_t* fHyphens = (uint8_t*)calloc( params._onlyAll?19:(params.onlyDec?5:0) + (params.onlyOct?5:0) + (params.onlyHex?5:0) + (params.onlyChar?4:0),sizeof(uint8_t));
memset(fHyphens, (uint8_t)45, sizeof(uint8_t) * (params._onlyAll?19:(params.onlyDec?5:0) + (params.onlyOct?5:0) + (params.onlyHex?5:0) + (params.onlyChar?4:0)));

printf("%s%s",fHyphens,hyphens);
if(col-1 != i) printf("+--");
Expand Down

0 comments on commit 59afb70

Please sign in to comment.