Redo the utils file

This commit is contained in:
Curle 2019-09-11 03:59:01 +01:00
parent b13f7e6755
commit 2536c58607

View File

@ -93,7 +93,7 @@ int memcmp (const void *str1, const void *str2, size_t count) {
* @param string: The string to be written into.
*/
void int_to_ascii(int num, char* string) {
void inttoa(int num, char* string) {
size_t i = 0; //Counter.
// TODO: Convert this to a for-loop?
int32_t calc = 0;
@ -157,8 +157,8 @@ char* itoc(size_t num) {
* @param num: Number to convert
* @param string: String pointer to put the converted number.
*/
void int_to_hex(int num, char* string) {
empty_string(string);
void itoh(int num, char* string) {
zeroString(string);
uint8_t i = 8;
uint8_t temp = 0;
@ -182,7 +182,7 @@ void int_to_hex(int num, char* string) {
* @param string: The string to empty.
*/
void empty_string(char* string) {
void zeroString(char* string) {
size_t len = strlen(string);
for(size_t i = 0; i < len + 1; i++) {