[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 08/10] linux-user: factor out reading of /proc/self/maps
From: |
Richard Henderson |
Subject: |
Re: [PATCH v2 08/10] linux-user: factor out reading of /proc/self/maps |
Date: |
Thu, 2 Apr 2020 09:58:19 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 |
On 4/1/20 2:47 AM, Alex Bennée wrote:
> +typedef struct {
> + uint64_t start;
> + uint64_t end;
...
> + errors = qemu_strtoul(fields[0], &end, 16, &e->start);
> + errors += qemu_strtoul(end + 1, NULL, 16, &e->end);
uint64_t vs unsigned long -- you want qemu_strtou64.
> + errors += qemu_strtoul(fields[2], NULL, 16, &e->offset);
Likewise.
> + /* A bit ugly as strsplit doesn't skip multiple separators */
> + if (g_strv_length(fields) > 6) {
> + e->path = g_strdup(fields[g_strv_length(fields) - 1]);
> + }
And if the path contains spaces?
r~
- [PATCH for 5.0 v2 00/10] A selection of sanitiser fixes, Alex Bennée, 2020/04/01
- [PATCH v2 01/10] elf-ops: bail out if we have no function symbols, Alex Bennée, 2020/04/01
- [PATCH v2 03/10] tests/tcg: remove extraneous pasting macros, Alex Bennée, 2020/04/01
- [PATCH v2 02/10] linux-user: protect fcntl64 with an #ifdef, Alex Bennée, 2020/04/01
- [PATCH v2 04/10] linux-user: more debug for init_guest_space, Alex Bennée, 2020/04/01
- [PATCH v2 05/10] target/xtensa: add FIXME for translation memory leak, Alex Bennée, 2020/04/01
- [PATCH v2 06/10] gdbstub: fix compiler complaining, Alex Bennée, 2020/04/01
- [PATCH v2 07/10] softfloat: Fix BAD_SHIFT from normalizeFloatx80Subnormal, Alex Bennée, 2020/04/01
- [PATCH v2 08/10] linux-user: factor out reading of /proc/self/maps, Alex Bennée, 2020/04/01
- Re: [PATCH v2 08/10] linux-user: factor out reading of /proc/self/maps,
Richard Henderson <=
- [PATCH v2 09/10] linux-user: clean-up padding on /proc/self/maps, Alex Bennée, 2020/04/01
- [PATCH v2 10/10] linux-user: completely re-write init_guest_space, Alex Bennée, 2020/04/01