|
@ -24,6 +24,7 @@ char* convertIntToBinaryStr(int input){ |
|
|
int length = binaryStrLen(input); |
|
|
int length = binaryStrLen(input); |
|
|
int rest; |
|
|
int rest; |
|
|
char* result = (char*)malloc(sizeof(char) * length + 1); |
|
|
char* result = (char*)malloc(sizeof(char) * length + 1); |
|
|
|
|
|
if(result == NULL) return NULL; |
|
|
if(input < 0){ |
|
|
if(input < 0){ |
|
|
result[0] = '-'; |
|
|
result[0] = '-'; |
|
|
input *= -1; |
|
|
input *= -1; |
|
@ -67,6 +68,7 @@ char* convertIntToHex(int input){ |
|
|
int length = hexStrLen(input); |
|
|
int length = hexStrLen(input); |
|
|
int rest; |
|
|
int rest; |
|
|
char* result = (char*)malloc(sizeof(char) * length + 1); |
|
|
char* result = (char*)malloc(sizeof(char) * length + 1); |
|
|
|
|
|
if(result == NULL) return NULL; |
|
|
result[length] = '\0'; |
|
|
result[length] = '\0'; |
|
|
do{ |
|
|
do{ |
|
|
rest = input % 16; |
|
|
rest = input % 16; |
|
|