Update BDK to Hekate 6.0.5

This commit is contained in:
suchmememanyskill
2023-07-20 16:45:07 +02:00
parent 09fc492610
commit ee6ea3e64c
103 changed files with 6271 additions and 3746 deletions

View File

@@ -36,14 +36,24 @@ static void _s_puts(char *s)
static void _s_putn(u32 v, int base, char fill, int fcnt)
{
char buf[65];
static const char digits[] = "0123456789ABCDEFghijklmnopqrstuvwxyz";
char *p;
int c = fcnt;
static const char digits[] = "0123456789ABCDEF";
if (base > 36)
char *p;
char buf[65];
int c = fcnt;
bool negative = false;
if (base != 10 && base != 16)
return;
// Account for negative numbers.
if (base == 10 && v & 0x80000000)
{
negative = true;
v = (int)v * -1;
c--;
}
p = buf + 64;
*p = 0;
do
@@ -53,9 +63,12 @@ static void _s_putn(u32 v, int base, char fill, int fcnt)
v /= base;
} while (v);
if (negative)
*--p = '-';
if (fill != 0)
{
while (c > 0)
while (c > 0 && p > buf)
{
*--p = fill;
c--;
@@ -73,9 +86,9 @@ void s_printf(char *out_buf, const char *fmt, ...)
sout_buf = &out_buf;
va_start(ap, fmt);
while(*fmt)
while (*fmt)
{
if(*fmt == '%')
if (*fmt == '%')
{
fmt++;
fill = 0;
@@ -96,7 +109,7 @@ void s_printf(char *out_buf, const char *fmt, ...)
fcnt -= '0';
}
}
switch(*fmt)
switch (*fmt)
{
case 'c':
_s_putc(va_arg(ap, u32));
@@ -140,9 +153,9 @@ void s_vprintf(char *out_buf, const char *fmt, va_list ap)
sout_buf = &out_buf;
while(*fmt)
while (*fmt)
{
if(*fmt == '%')
if (*fmt == '%')
{
fmt++;
fill = 0;