[Toybox] [PATCH] devmem: Fix 8 byte wide writes

Michael Shavit mshavit at google.com
Mon Sep 18 16:08:44 PDT 2023


On Thu, Aug 31, 2023 at 3:57 AM Rob Landley <rob at landley.net> wrote:
> +unsigned long long atollu(char *str)
> +{
> +  char *end = str;
> +  unsigned long long llu = strtoul(str, &end, 0);

Sorry I didn't notice this earlier, but hortune at google.com pointed out
that we should be using strtoull() here. This supposedly isn't an
issue on 64bit systems since toybox already assumes unsigned long and
unsigned long long to both be exactly 64 bits, but could be
problematic for a 32bit system where the two types have different
sizes (although I haven't fully thought through the implications).

On second look, shouldn't we also be checking errno?


More information about the Toybox mailing list