Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion saturnringlib/srl_string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ namespace SRL
}

/**
* @brief Extension of snprintf with support of SRL::Math::Types::Fxp. Supported format especifiers %c , %s , %u , %d, and %f. %f is used for FXP types.
* @brief Extension of snprintf with support of SRL::Math::Types::Fxp. Supported format specifiers %c , %s , %u , %d, %x and %f. %f is used for FXP types. %0Nd where N is the total lenght of the printed number. If under N , the number will be padded with 0's until the printed string has N characters
* @param buffer Buffer where the string will be written to
* @param size maximum size of string to be written into buffer
* @param format format string
Expand Down Expand Up @@ -218,6 +218,21 @@ namespace SRL
}
}
break;
case 'x' : //hexadecimal
{
char tmp[100] = {0};
int arg = va_arg(args, int);
snprintf(tmp, 100, "%x", arg);
for(int jdx = 0; tmp[jdx] != 0 ; jdx++ , writtenChars++)
{
if(writtenChars < size)
{
buffer[writtenChars] = tmp[jdx];
}

}
}
break;
case 'u' : //unsigned int
{
char tmp[100] = {0};
Expand Down
Loading