Skip to content

Commit

Permalink
vsprintf: expose strtoul function
Browse files Browse the repository at this point in the history
This function is a wrapper around simple_strtoul, and allows us to expose
it, replacing the one in bionic.c.

Signed-off-by: Sean Cross <[email protected]>
  • Loading branch information
Sean Cross committed Nov 28, 2014
1 parent 2e3dfee commit 58d7c3b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd-lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ int cmd_lcd(int argc, char **argv)
for (x = 0; x < lcd_width(); x++)
lcd_addpixel(rgb(i++, 0, 0));
}
else if (is_command(argc, argv, "tps")) {
else if (is_command(argc, argv, "tpd")) {
static int step = 0;
pixel_t *fb;
int x, y;
Expand Down
7 changes: 6 additions & 1 deletion vsprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ int strict_strtoul(const char *cp, unsigned int base, unsigned long *res)
return -EINVAL;
}

unsigned long strtoul(const char *cp, char **endp, unsigned int base)
{
return simple_strtoul(cp, endp, base);
}

long simple_strtol(const char *cp,char **endp,unsigned int base)
{
if(*cp=='-')
Expand Down Expand Up @@ -661,7 +666,7 @@ static int vsnprintf_internal(char *buf, size_t size, const char *fmt,
} else if (qualifier == 'Z' || qualifier == 'z') {
num = va_arg(args, size_t);
} else if (qualifier == 't') {
num = va_arg(args, ptrdiff_t);
num = va_arg(args, void *);
} else if (qualifier == 'h') {
num = (unsigned short) va_arg(args, int);
if (flags & SIGN)
Expand Down

0 comments on commit 58d7c3b

Please sign in to comment.